com.myJava.system
Class OSTool

java.lang.Object
  extended by com.myJava.system.OSTool

public class OSTool
extends java.lang.Object

Utility class for all system calls

Author:
Olivier PETRUCCI

Areca Build ID : 7299034069467778562

Constructor Summary
OSTool()
           
 
Method Summary
static int execute(java.lang.String[] cmd)
           
static int execute(java.lang.String[] cmd, boolean async)
           
static java.lang.String formatJavaVersion(int[] version)
           
static java.nio.charset.Charset[] getCharsets()
           
static java.lang.String getFormattedJavaVersion()
           
static long getFreeMemory()
           
static java.lang.String getIANAFileEncoding()
           
static java.lang.String getJavaFileEncoding()
           
static java.lang.String getJavaVendor()
           
static int[] getJavaVersion()
           
static java.lang.String getLineSeparator()
           
static long getMaxMemory()
           
static long getMaxMemoryKB()
           
static long getMaxMemoryMB()
           
static long getMemoryUsage()
           
static java.lang.String getOSDescription()
           
static java.lang.String getTempDirectory()
           
static long getTotalMemory()
           
static java.lang.String getUserDir()
           
static java.lang.String getUserHome()
           
static java.lang.String getUserLanguage()
           
static java.lang.String getUserName()
           
static java.lang.String getVMDescription()
           
static boolean isJavaVersionGreaterThanOrEquals(int[] referenceVersion)
           
static boolean isSystemMACOS()
           
static boolean isSystemWindows()
           
static void launchBrowser(java.lang.String url)
          Attempts to launch the default external browser.
static void launchBrowser(java.net.URL url)
          Attempts to launch the default external browser.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OSTool

public OSTool()
Method Detail

getCharsets

public static java.nio.charset.Charset[] getCharsets()

getOSDescription

public static java.lang.String getOSDescription()

getJavaFileEncoding

public static java.lang.String getJavaFileEncoding()

getIANAFileEncoding

public static java.lang.String getIANAFileEncoding()

getUserLanguage

public static java.lang.String getUserLanguage()

getLineSeparator

public static java.lang.String getLineSeparator()

getUserHome

public static java.lang.String getUserHome()

getUserDir

public static java.lang.String getUserDir()

getUserName

public static java.lang.String getUserName()

getTempDirectory

public static java.lang.String getTempDirectory()

launchBrowser

public static void launchBrowser(java.net.URL url)
                          throws OSToolException,
                                 NoBrowserFoundException
Attempts to launch the default external browser.

Throws:
OSToolException
NoBrowserFoundException

execute

public static int execute(java.lang.String[] cmd)
                   throws java.io.IOException
Throws:
java.io.IOException

execute

public static int execute(java.lang.String[] cmd,
                          boolean async)
                   throws java.io.IOException
Throws:
java.io.IOException

launchBrowser

public static void launchBrowser(java.lang.String url)
                          throws OSToolException,
                                 NoBrowserFoundException
Attempts to launch the default external browser.

Throws:
OSToolException
NoBrowserFoundException

isSystemWindows

public static boolean isSystemWindows()

isSystemMACOS

public static boolean isSystemMACOS()

getMaxMemory

public static long getMaxMemory()

getMaxMemoryKB

public static long getMaxMemoryKB()

getMaxMemoryMB

public static long getMaxMemoryMB()

getTotalMemory

public static long getTotalMemory()

getFreeMemory

public static long getFreeMemory()

getMemoryUsage

public static long getMemoryUsage()

getJavaVersion

public static int[] getJavaVersion()

getFormattedJavaVersion

public static java.lang.String getFormattedJavaVersion()

getVMDescription

public static java.lang.String getVMDescription()

isJavaVersionGreaterThanOrEquals

public static boolean isJavaVersionGreaterThanOrEquals(int[] referenceVersion)

getJavaVendor

public static java.lang.String getJavaVendor()

formatJavaVersion

public static java.lang.String formatJavaVersion(int[] version)