Package net.simplace.core.service
Class FileExecuteHelper
java.lang.Object
net.simplace.core.service.FileExecuteHelper
This Class runs a extern Application with a certain document/file
from wich the Filename is given.
- Author:
- Andreas Enders
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringexecuteApplication(String aAppName, File aWorkingDir) Invokes an executable.static ProcessexecuteExecutable(String aWholePathAndProgName) Calls the executable.static ProcessexecuteFile(File aFile) Opens the file in the registered applicationstatic ProcessexecuteFile(String aFileName) executes a file returning the Process-Object for excepion-case null is returnedstatic ProcessexecuteFileExtern(File aFile) Opens the file in the registered system-application.static ProcessexecuteFileExtern(File aFile, boolean aCreateTemporaryCopy) Opens the file in the registered system-application.static ProcessexecuteFileExtern(String aFile) Opens the file in the registered system-application.static voidexecuteScript(String aPath, String aExecutableName, String aParameterString) static voidnewMailInStandardClient(List<String> aToAddrsList, String aSubject, String aBody, String aAttachementPath) Opens the standard E-Mail-Client.static voidshowInExternalBrowser(String aURL, boolean aNewWindows)
-
Constructor Details
-
FileExecuteHelper
public FileExecuteHelper()
-
-
Method Details
-
showInExternalBrowser
public static void showInExternalBrowser(String aURL, boolean aNewWindows) throws edu.stanford.ejalbert.exception.BrowserLaunchingInitializingException, edu.stanford.ejalbert.exception.UnsupportedOperatingSystemException - Parameters:
aURL-aNewWindows-- Throws:
edu.stanford.ejalbert.exception.BrowserLaunchingInitializingExceptionedu.stanford.ejalbert.exception.UnsupportedOperatingSystemException
-
executeFile
Opens the file in the registered application- Parameters:
aFile-- Returns:
- opened file Process
- Throws:
ExecutionException
-
executeFile
executes a file returning the Process-Object for excepion-case null is returned- Parameters:
aFileName-- Returns:
- opened file Process or null for excepion-case
-
executeFileExtern
Opens the file in the registered system-application. CAVEAT: Changes to this method must be tested against all supportet Windows-Versions.- Parameters:
aFile-- Returns:
- opened file Process
- Throws:
ExecutionException
-
executeFileExtern
Opens the file in the registered system-application. CAVEAT: Changes to this method must be tested against all supportet Windows-Versions.- Parameters:
aFile-- Returns:
- opened file Process
- Throws:
ExecutionException
-
executeFileExtern
public static Process executeFileExtern(File aFile, boolean aCreateTemporaryCopy) throws ExecutionException Opens the file in the registered system-application.- Parameters:
aFile-aCreateTemporaryCopy- - If true, a copy of the file to be executed will be created and the copy will be executed. This can be done to prevent certain documents from being edited, i. e. offer documents. CAVEAT: Changes to this method must be tested against all supportet Windows-Versions.- Returns:
- opened file Process
- Throws:
ExecutionException
-
executeExecutable
Calls the executable.- Parameters:
aWholePathAndProgName-- Returns:
- executing file Process
-
executeApplication
Invokes an executable. Returns stdout as String.- Parameters:
aAppName-aWorkingDir-- Returns:
- stdout as String
- Throws:
IOException
-
executeScript
public static void executeScript(String aPath, String aExecutableName, String aParameterString) throws ExecutionException - Parameters:
aPath-aExecutableName-aParameterString-- Throws:
ExecutionException
-
newMailInStandardClient
public static void newMailInStandardClient(List<String> aToAddrsList, String aSubject, String aBody, String aAttachementPath) throws IOException Opens the standard E-Mail-Client.- Parameters:
aToAddrsList- List of Strings with valid E-Mail-adresses.aSubject-aBody-aAttachementPath-- Throws:
IOException
-