Package com.actelion.research.util
Class Platform
- java.lang.Object
-
- com.actelion.research.util.Platform
-
public class Platform extends java.lang.ObjectRequires JRE 1.6
-
-
Constructor Summary
Constructors Constructor Description Platform()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidexecute(java.lang.String[] programAndArgs)Start an executable with parameters.static java.lang.Processexecute(java.lang.String program, java.lang.String... args)Start an executable with parameters.static booleanis64BitJRE()static booleanisLinux()static booleanisMacintosh()static booleanisUnix()static booleanisWindows()static voidopenDocument(java.lang.String doc)Given a filename, open this file with the default applicationstatic java.lang.ProcesssystemExec(java.lang.String[] programAndArgs)Wrapper for Runtime.exec() that allows different handling by platform This method fixes forking issues in Windows when starting Mercury (by default new processes do not seem to be forked correctly)
-
-
-
Method Detail
-
isWindows
public static boolean isWindows()
-
isMacintosh
public static boolean isMacintosh()
-
isLinux
public static boolean isLinux()
-
isUnix
public static boolean isUnix()
-
is64BitJRE
public static boolean is64BitJRE()
-
execute
public static java.lang.Process execute(java.lang.String program, java.lang.String... args) throws java.io.IOExceptionStart an executable with parameters. In non-windows environment this is searching the PATH In the windows environment @Actelion this first checks the standard locations where applications are installed usually \\actelch02\pgm. This is achieved by consulting the ApplicationDatabase.db file located under \\actelch02\pgm\ActelionResearch. The file format is a standard Java properties file where the key contains the name of the application and the value the respective absolute path of the executable e.g. datawarrior=//actelch02/pgm/Datawarrior/DataWarrior.exe- Parameters:
program-args-- Throws:
java.io.IOException
-
execute
public static void execute(java.lang.String[] programAndArgs) throws java.io.IOExceptionStart an executable with parameters. In non-windows environment this is searching the PATH In the windows environment @Actelion this first checks the standard locations where applications are installed usually \\actelch02\pgm. This is achieved by consulting the ApplicationDatabase.db file located under \\actelch02\pgm\ActelionResearch. The file format is a standard Java properties file where the key contains the name of the application and the value the respective absolute path of the executable e.g. datawarrior=//actelch02/pgm/Datawarrior/DataWarrior.exe- Parameters:
programAndArgs-- Throws:
java.io.IOException
-
systemExec
public static java.lang.Process systemExec(java.lang.String[] programAndArgs) throws java.io.IOExceptionWrapper for Runtime.exec() that allows different handling by platform This method fixes forking issues in Windows when starting Mercury (by default new processes do not seem to be forked correctly)- Parameters:
programAndArgs-- Returns:
- Throws:
java.io.IOException
-
openDocument
public static void openDocument(java.lang.String doc) throws java.io.IOException, java.lang.UnsupportedOperationExceptionGiven a filename, open this file with the default application- Parameters:
doc- File name to open- Throws:
java.io.IOException- if the file is unavailablejava.lang.UnsupportedOperationException
-
-