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
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
executeApplication
(String aAppName, File aWorkingDir) Invokes an executable.static Process
executeExecutable
(String aWholePathAndProgName) Calls the executable.static Process
executeFile
(File aFile) Opens the file in the registered applicationstatic Process
executeFile
(String aFileName) executes a file returning the Process-Object for excepion-case null is returnedstatic Process
executeFileExtern
(File aFile) Opens the file in the registered system-application.static Process
executeFileExtern
(File aFile, boolean aCreateTemporaryCopy) Opens the file in the registered system-application.static Process
executeFileExtern
(String aFile) Opens the file in the registered system-application.static void
executeScript
(String aPath, String aExecutableName, String aParameterString) static void
newMailInStandardClient
(List<String> aToAddrsList, String aSubject, String aBody, String aAttachementPath) Opens the standard E-Mail-Client.static void
showInExternalBrowser
(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.BrowserLaunchingInitializingException
edu.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
-