| java.lang.Object snow.utils.SysUtils
SysUtils | final public class SysUtils (Code) | | System utilities, normally working on Windows and on Linux.
Windows XP: ok. 2000 needs sysinternals shutdown utility...
Suse Linux:ok, Unbuntu:ok
|
Method Summary | |
public static boolean | checkKill() | public static boolean | checkShutdown(boolean forceUsingPSTool) Asks for windows 2000: psshutdown. | public static boolean | is_MAC_OS() | public static boolean | is_Windows_OS() | public static void | killProcess(String id) | public static void | lockWorkStation() | public static void | main(String[] arguments) | public static void | openBrowser(String url) | public static void | openDocumentInSystem(String absoluteLinkPath, boolean isHTTP) Suitable for pdf, txt, ... | public static void | openFileExplorer(File dir) On windows, single files are "executed" by the system, with the associated file. | public static void | printPDF(String pdfPath) | final public static void | redirectSystemOutput(String logPath, boolean debug) Redirects System.out and System.err to the given file. | public static boolean | setReadWriteAttribs(File f, String windowsGroup) | public static void | shutdown(int delaySec, boolean restart, String comment_, boolean forceUsingSysInternals) NOTE: can be undone with the command "shutdown -a". |
checkKill | public static boolean checkKill()(Code) | | Asks for windows 2000: pskill
|
checkShutdown | public static boolean checkShutdown(boolean forceUsingPSTool)(Code) | | Asks for windows 2000: psshutdown.
|
is_MAC_OS | public static boolean is_MAC_OS()(Code) | | |
is_Windows_OS | public static boolean is_Windows_OS()(Code) | | |
killProcess | public static void killProcess(String id) throws Exception(Code) | | Sometimes fail !!!, the process say "SUCCESS: has been terminated",
but the process stil lives ! and jps says "( process information unavailable)"
|
lockWorkStation | public static void lockWorkStation()(Code) | | |
openDocumentInSystem | public static void openDocumentInSystem(String absoluteLinkPath, boolean isHTTP) throws Exception(Code) | | Suitable for pdf, txt, ...
|
openFileExplorer | public static void openFileExplorer(File dir)(Code) | | On windows, single files are "executed" by the system, with the associated file.
|
redirectSystemOutput | final public static void redirectSystemOutput(String logPath, boolean debug)(Code) | | Redirects System.out and System.err to the given file.
|
setReadWriteAttribs | public static boolean setReadWriteAttribs(File f, String windowsGroup) throws Exception(Code) | | Parameters: windowsGroup - is normally "Users" |
shutdown | public static void shutdown(int delaySec, boolean restart, String comment_, boolean forceUsingSysInternals) throws Exception(Code) | | NOTE: can be undone with the command "shutdown -a".
2000: must install a tool: http://www.microsoft.com/technet/sysinternals/utilities/psshutdown.mspx
XP: must have the correct policy set.
if the windows command fails (too less privileges), calls sysinternals.
XP: if failing, says (STUPID!)
SysUtils> The operation completed successfully.
SysUtils> A required privilege is not held by the client.
=>I Prefer using always sysinternals...
|
|
|