|
APTCONVERT 1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfr.pixware.util.PlatformUtil
A collection of utility functions (static methods) returning information which is platform dependant.
Constructor Summary | |
PlatformUtil()
|
Method Summary | |
static java.lang.String |
commandSeparator()
Returns the command separator of the standard shell of the platform. |
static java.lang.String |
homeDir()
Returns the name of the home directory of current user. |
static java.lang.String |
platform()
Returns the name of the platform Java is running on. |
static java.lang.String |
rcFileName(java.lang.String appName)
Returns the name of the user preference file associated to the specified application. |
static int |
shellExec(java.lang.String command)
Executes a command using the standard shell of the platform. |
static int |
shellExec(java.lang.String command,
boolean verbose)
Executes a command using the standard shell of the platform. |
static java.lang.String |
tmpDir()
Returns the name of directory where temporary files can be created safely. |
static java.lang.String |
tmpFileName()
Returns the name of a temporary file ending with extension ".tmp". |
static java.lang.String |
tmpFileName(java.lang.String extension)
Returns the name of a temporary file ending with the specified extension. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PlatformUtil()
Method Detail |
public static java.lang.String platform()
public static java.lang.String homeDir()
null
if the candidate directory found by this function
does not exist or is not a directory.public static java.lang.String rcFileName(java.lang.String appName)
Note that RC means Runtime Configuration.
appName
- the application name
null
if
the user HOME directory is unknownhomeDir()
public static java.lang.String tmpFileName()
tmpDir()
.
public static java.lang.String tmpFileName(java.lang.String extension)
tmpDir()
.
extension
- the desired extension for the file name; if a dot is
required, add it at the start of extension
public static java.lang.String tmpDir()
Under Windows, the system property TMP or TEMP, if set to an existing directory, may be used to force the value returned by this function.
Under Unix, this function always returns "/tmp".
null
if the
candidate directory found by this function does not exist or is not a
directory.public static int shellExec(java.lang.String command) throws java.io.IOException, java.lang.InterruptedException
command
- the shell command to be executed
java.io.IOException
- if an I/O error occurs
java.lang.InterruptedException
- if the current thread is interrupted by
another thread while it is waiting the completion of the shell commandpublic static int shellExec(java.lang.String command, boolean verbose) throws java.io.IOException, java.lang.InterruptedException
command
- the shell command to be executedverbose
- if true, the shell command output on
System.out
and System.err
is echoed; if
false, this output is discarded
java.io.IOException
- if an I/O error occurs
java.lang.InterruptedException
- if the current thread is interrupted by
another thread while it is waiting the completion of the shell commandpublic static java.lang.String commandSeparator()
|
APTCONVERT 1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |