java.lang.Objectjwrapper.jwutils.JWGenericOS
jwrapper.jwutils.JWWindowsOS
public class JWWindowsOS
Utility APIs for Windows
Nested Class Summary | |
---|---|
class |
JWWindowsOS.NetworkAdapterInfo
|
class |
JWWindowsOS.OSVersionInfo
|
static class |
JWWindowsOS.RDPSessionInfo
|
Constructor Summary | |
---|---|
JWWindowsOS()
|
Method Summary | |
---|---|
void |
createShortcut(java.io.File linkfile,
java.io.File target)
|
void |
createShortcut(java.io.File linkfile,
java.io.File target,
java.lang.String args)
|
void |
createShortcut(java.io.File linkfile,
java.lang.String linkDesc,
java.io.File target,
java.lang.String args,
java.io.File icon,
int iconIndex)
|
void |
createShortcutWithAppID(java.io.File linkfile,
java.io.File target,
java.lang.String appID)
|
void |
createShortcutWithAppID(java.io.File linkfile,
java.io.File target,
java.lang.String args,
java.lang.String appID)
|
void |
createShortcutWithAppID(java.io.File linkfile,
java.lang.String linkDesc,
java.io.File target,
java.lang.String args,
java.io.File icon,
int iconIndex,
java.lang.String appID)
|
void |
createWebShortcut(java.io.File linkfile,
java.lang.String targetURL)
|
void |
createWebShortcut(java.io.File linkfile,
java.lang.String targetURL,
java.io.File iconFile,
int iconIndex)
|
void |
deleteShortcut(java.io.File linkfile)
|
void |
deleteWebShortcut(java.io.File linkfile)
|
java.lang.String[] |
getAllConsoleUsers()
Get the console user (the user logged into the console session) |
java.lang.String |
getAllUsersStartMenuProgramsFolder()
This is language specific in XP so cannot easily be recreated based on environment variables E.g. |
java.io.File |
getAppStartMenuFolder()
Get the start menu folder for the app bundle (will return current user or all users folder depending on install type for the bundle). |
int[] |
getCaretLocation()
Get the caret (text cursor) location |
java.lang.String |
getEnvironmentVariable(java.lang.String name)
Get a Windows environment variable |
java.lang.String |
getEnvShortPath(java.lang.String env)
Return the value of the path referenced by the environment variable env, and convert to 8.3 short path format if possible. |
java.lang.String |
getHostname()
|
java.lang.String |
getLoggedOnUsername()
Get the username for the currently logged on session that this JVM is running in |
java.lang.String |
getLoggedOnUserSID()
Get the SID of the user that is currently logged in |
int[] |
getMouseLocation()
Get the mouse pointer location |
JWWindowsOS.NetworkAdapterInfo[] |
getNetworkInfo()
|
java.lang.String |
getOSName()
Return the OS name - utility for getting accurate OS names even with older JVMs. |
java.lang.String |
getOSNameWithBitness()
Return the OS name with x86 for 32bit systems and x64 for 64bit systems |
JWWindowsOS.OSVersionInfo |
getOSVersionInfo()
Return Windows specific versioning information |
JWWindowsOS.RDPSessionInfo[] |
getRDPSessionInfos()
|
static java.lang.String |
getRequestedURL()
Returns the requested URL if this application was launched using a URL handler |
java.lang.String |
getShortPathFormatFor(java.lang.String fullPath)
Returns a 8.3 formatted short path name for the given full path. |
java.io.File |
getStartMenuFolder(java.lang.String group)
Get a start menu folder, or the start menu itself if group is null |
java.lang.String |
getUserStartMenuProgramsFolder()
This is language specific in XP so cannot easily be recreated based on environment variables E.g. |
static JWWindowsOS |
getWindowsInstance()
|
boolean |
is64BitWindowsOS()
Return true if this Windows OS is 64 bit |
boolean |
isProcessDPIAware()
Return true of the process is set as DPI aware. |
boolean |
killProcess(int pid)
|
void |
makeCurrentProcessHighPriority()
Make the currently running JVM a high priority process |
void |
makeCurrentProcessLowPriority()
Make the currently running JVM a low priority process |
void |
makeCurrentProcessNormalPriority()
Make the currently running JVM a normal priority process |
static void |
registerURLSchemeForVirtualApp(java.lang.String schemeProtocol,
java.lang.String virtualApp)
|
void |
setFrameAlwaysOnTop(java.awt.Frame window)
Set a Java Frame to be 'always on top' (in the Windows sense - the Frame will be kept on top of other windows) |
void |
setWindowAlwaysOnTop(java.awt.Window window)
Set a Java Window to be 'always on top' (in the Windows sense - the Window will be kept on top of other windows) |
boolean |
setWindowsAppID(java.lang.String appID)
Set the Windows App ID - used to group processes together by application ID. |
Methods inherited from class jwrapper.jwutils.JWGenericOS |
---|
getCurrentProcessID, getInstance, getOSVersion, setCurrentDirectory, setReadableForAllUsers, setReadableForAllUsersAndWait, setWritableForAllUsers, setWritableForAllUsersAndWait, terminateProcess |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JWWindowsOS()
Method Detail |
---|
public void createShortcut(java.io.File linkfile, java.io.File target) throws java.io.IOException
java.io.IOException
public void createShortcut(java.io.File linkfile, java.io.File target, java.lang.String args) throws java.io.IOException
java.io.IOException
public void createShortcut(java.io.File linkfile, java.lang.String linkDesc, java.io.File target, java.lang.String args, java.io.File icon, int iconIndex) throws java.io.IOException
java.io.IOException
public void createShortcutWithAppID(java.io.File linkfile, java.io.File target, java.lang.String appID) throws java.io.IOException
java.io.IOException
public void createShortcutWithAppID(java.io.File linkfile, java.io.File target, java.lang.String args, java.lang.String appID) throws java.io.IOException
java.io.IOException
public void createShortcutWithAppID(java.io.File linkfile, java.lang.String linkDesc, java.io.File target, java.lang.String args, java.io.File icon, int iconIndex, java.lang.String appID) throws java.io.IOException
java.io.IOException
public void createWebShortcut(java.io.File linkfile, java.lang.String targetURL) throws java.io.IOException
java.io.IOException
public void createWebShortcut(java.io.File linkfile, java.lang.String targetURL, java.io.File iconFile, int iconIndex) throws java.io.IOException
java.io.IOException
public void deleteShortcut(java.io.File linkfile) throws java.io.IOException
java.io.IOException
public void deleteWebShortcut(java.io.File linkfile) throws java.io.IOException
java.io.IOException
public java.lang.String[] getAllConsoleUsers()
getAllConsoleUsers
in class JWGenericOS
public java.lang.String getAllUsersStartMenuProgramsFolder()
public java.io.File getAppStartMenuFolder()
public int[] getCaretLocation()
public java.lang.String getEnvironmentVariable(java.lang.String name)
name
- the name of the environment variable
public java.lang.String getEnvShortPath(java.lang.String env)
public java.lang.String getHostname()
getHostname
in class JWGenericOS
public java.lang.String getLoggedOnUsername()
public java.lang.String getLoggedOnUserSID()
public int[] getMouseLocation()
public JWWindowsOS.NetworkAdapterInfo[] getNetworkInfo()
public java.lang.String getOSName()
JWGenericOS
getOSName
in class JWGenericOS
public java.lang.String getOSNameWithBitness()
JWGenericOS
getOSNameWithBitness
in class JWGenericOS
public JWWindowsOS.OSVersionInfo getOSVersionInfo()
public JWWindowsOS.RDPSessionInfo[] getRDPSessionInfos()
public static java.lang.String getRequestedURL()
public java.lang.String getShortPathFormatFor(java.lang.String fullPath)
public java.io.File getStartMenuFolder(java.lang.String group)
group
- the sub-folder to create in the start menu, or null if the root start menu folder
public java.lang.String getUserStartMenuProgramsFolder()
public static JWWindowsOS getWindowsInstance()
public boolean is64BitWindowsOS()
public boolean isProcessDPIAware()
public boolean killProcess(int pid)
public void makeCurrentProcessHighPriority()
public void makeCurrentProcessLowPriority()
public void makeCurrentProcessNormalPriority()
public static void registerURLSchemeForVirtualApp(java.lang.String schemeProtocol, java.lang.String virtualApp) throws java.io.IOException, java.lang.InterruptedException
java.io.IOException
java.lang.InterruptedException
public void setFrameAlwaysOnTop(java.awt.Frame window)
public void setWindowAlwaysOnTop(java.awt.Window window)
public boolean setWindowsAppID(java.lang.String appID)