com.denova.runtime
Class OS

java.lang.Object
  extended by com.denova.runtime.OS

public class OS
extends java.lang.Object


Field Summary
static java.lang.String X32Architecture
           
static java.lang.String X64Architecture
           
 
Constructor Summary
OS()
           
 
Method Summary
static java.lang.String[] addArg(java.lang.String[] args, java.lang.String newArg)
          Adds an argument to an array of arguments.
static java.lang.String[] getEnvironment()
          Deprecated.  
static java.lang.String getOsName()
           
static java.lang.String getSystemPath()
          Get the system's path from the environment on Unix or Windows OSes.
static java.lang.String getVersion()
           
static boolean installService(java.lang.String serviceName, java.lang.String executable)
          Install a service.
static boolean isAix()
           
static boolean isHpUnix()
           
static boolean isLinux()
           
static boolean isMac()
           
static boolean isMacOsX()
           
static boolean isMpeUnix()
           
static boolean isNetware()
           
static boolean isOs2()
           
static boolean isSecureWindows()
          Determines if current computer is running one of the more modern versions of Windows that requires more security.
static boolean isSolaris()
           
static boolean isUnix()
           
static boolean isWindows()
           
static boolean isWindows2000()
           
static boolean isWindows7()
           
static boolean isWindows8()
           
static boolean isWindows95()
           
static boolean isWindows98()
           
static boolean isWindowsNT()
           
static boolean isWindowsServer2003()
           
static boolean isWindowsServer2008()
           
static boolean isWindowsVista()
           
static boolean isWindowsXP()
           
static boolean ln(java.lang.String existingFilename, java.lang.String linkedFilename)
          Symbolically link a file.
static boolean removeService(java.lang.String serviceName, java.lang.String executable)
          Remove a service.
static void sleep(long millseconds)
          Sleep and trap for any exceptions.
static boolean supportServices()
           
static void yield()
          Yield.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

X32Architecture

public static final java.lang.String X32Architecture
See Also:
Constant Field Values

X64Architecture

public static final java.lang.String X64Architecture
See Also:
Constant Field Values
Constructor Detail

OS

public OS()
Method Detail

isWindows

public static boolean isWindows()

isSecureWindows

public static boolean isSecureWindows()
Determines if current computer is running one of the more modern versions of Windows that requires more security.

Returns:
true if running on Windows Vista, Windows 7, Windows 8, or Windows Server 2008.

isWindowsVista

public static boolean isWindowsVista()
Returns:
true if this computer is running Windows Vista.

isWindows7

public static boolean isWindows7()
Returns:
true if this computer is running Windows 7.

isWindows8

public static boolean isWindows8()
Returns:
true if this computer is running Windows 8.

isWindows2000

public static boolean isWindows2000()
Returns:
true if this computer is running Windows 2000.

isWindowsNT

public static boolean isWindowsNT()
Returns:
true if this computer is running Windows NT.

isWindowsXP

public static boolean isWindowsXP()
Returns:
true if this computer is running Windows XP.

isWindowsServer2003

public static boolean isWindowsServer2003()
Returns:
true if this computer is running Windows Server 2003.

isWindowsServer2008

public static boolean isWindowsServer2008()
Returns:
true if this computer is running Windows Server 2008.

isWindows98

public static boolean isWindows98()
Returns:
true if this computer is running Windows 98.

isWindows95

public static boolean isWindows95()
Returns:
true if this computer is running Windows 95.

isUnix

public static boolean isUnix()
Returns:
true if this computer is running unix.

isLinux

public static boolean isLinux()
Returns:
true if this computer is running Linux.

isAix

public static boolean isAix()
Returns:
true if this computer is running IBM's AIX.

isHpUnix

public static boolean isHpUnix()
Returns:
true if this computer is running HP UX.

isSolaris

public static boolean isSolaris()
Returns:
true if this computer is running Solaris.

isMacOsX

public static boolean isMacOsX()
Returns:
true if this computer is running Mac OS X.

isMac

public static boolean isMac()
Returns:
true if this computer is running Mac OS X.

isOs2

public static boolean isOs2()
Returns:
true if this computer is running OS 2.

isNetware

public static boolean isNetware()
Returns:
true if this computer is running Netware.

isMpeUnix

public static boolean isMpeUnix()
Returns:
true if this computer is running MPE unix.

getOsName

public static java.lang.String getOsName()
Returns:
the name of the OS running on this computer.

getVersion

public static java.lang.String getVersion()
Returns:
the version of the OS running on this computer.

sleep

public static void sleep(long millseconds)
Sleep and trap for any exceptions.

Parameters:
millseconds - to sleep

yield

public static void yield()
Yield.


getSystemPath

public static java.lang.String getSystemPath()
Get the system's path from the environment on Unix or Windows OSes.

Returns:
string with the full path or null if unable to obtain path

ln

public static boolean ln(java.lang.String existingFilename,
                         java.lang.String linkedFilename)
Symbolically link a file.

Parameters:
existingFilename - file to create a link to
linkedFilename - symbolically linked file

getEnvironment

public static java.lang.String[] getEnvironment()
Deprecated. 

Get the environment on Unix or Windows OSes.

Returns:
string arrary with the environment or null if unable to obtain path.

addArg

public static java.lang.String[] addArg(java.lang.String[] args,
                                        java.lang.String newArg)
Adds an argument to an array of arguments.

Parameters:
args - The array of arguments
newArg - The new argument
Returns:
The array of arguments with the new argument added

installService

public static boolean installService(java.lang.String serviceName,
                                     java.lang.String executable)
Install a service.

Parameters:
serviceName - is the displayable name.
executable - is the pathname to the executable; use double quotes for filenames with spaces.
Returns:
true if successful.

removeService

public static boolean removeService(java.lang.String serviceName,
                                    java.lang.String executable)
Remove a service.

Parameters:
executable - is the pathname to the executable; use double quotes for filenames with spaces
Returns:
true if successful.

supportServices

public static boolean supportServices()
Returns:
true if OS supports services and API supports installing service on this distro.