- Timestamp:
- Mar 31, 2013, 6:02:09 PM (12 years ago)
- Location:
- java/PlatformTools/src/net/oni2/platformtools/applicationinvoker
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
java/PlatformTools/src/net/oni2/platformtools/applicationinvoker/ApplicationInvoker.java
r724 r767 19 19 public class ApplicationInvoker { 20 20 private static Vector<String> buildCommandLine(EExeType exeType, 21 File program, Vector<String> params )21 File program, Vector<String> params, boolean ignoreFileNotFound) 22 22 throws ERuntimeNotInstalledException, FileNotFoundException { 23 if (program.getParentFile() != null && !program.exists()) 24 throw new FileNotFoundException(); 23 if (!ignoreFileNotFound) 24 if (program.getParentFile() != null && !program.exists()) 25 throw new FileNotFoundException(); 25 26 Vector<String> cmdLine = new Vector<String>(); 26 27 switch (exeType) { … … 80 81 * @param params 81 82 * List of command and arguments 83 * @param ignoreFileNotFound 84 * Ignore if the program file is not found 82 85 * @return Error code and list of output lines 83 86 * @throws IOException … … 90 93 */ 91 94 public static ApplicationInvocationResult executeAndWait(EExeType exeType, 92 File workingDirectory, File program, Vector<String> params )93 throws ERuntimeNotInstalledException, FileNotFoundException,94 IOException {95 File workingDirectory, File program, Vector<String> params, 96 boolean ignoreFileNotFound) throws ERuntimeNotInstalledException, 97 FileNotFoundException, IOException { 95 98 return executeAndWait(workingDirectory, 96 buildCommandLine(exeType, program, params ));99 buildCommandLine(exeType, program, params, ignoreFileNotFound)); 97 100 } 98 101 … … 108 111 * @param params 109 112 * List of command and arguments 113 * @param ignoreFileNotFound 114 * Ignore if the program file is not found 110 115 * @throws ERuntimeNotInstalledException 111 116 * If the program to be executed requires a runtime which could … … 115 120 */ 116 121 public static void execute(EExeType exeType, File workingDirectory, 117 File program, Vector<String> params )122 File program, Vector<String> params, boolean ignoreFileNotFound) 118 123 throws ERuntimeNotInstalledException, FileNotFoundException { 119 execute(buildCommandLine(exeType, program, params), workingDirectory); 124 execute(buildCommandLine(exeType, program, params, ignoreFileNotFound), 125 workingDirectory); 120 126 } 121 127 -
java/PlatformTools/src/net/oni2/platformtools/applicationinvoker/DotNet.java
r724 r767 58 58 ApplicationInvocationResult res = null; 59 59 try { 60 res = ApplicationInvoker.executeAndWait(EExeType.OSBINARY, null, new File("which"), params );60 res = ApplicationInvoker.executeAndWait(EExeType.OSBINARY, null, new File("which"), params, false); 61 61 } catch (IOException e) { 62 62 e.printStackTrace(); -
java/PlatformTools/src/net/oni2/platformtools/applicationinvoker/Wine.java
r724 r767 36 36 try { 37 37 res = ApplicationInvoker.executeAndWait(EExeType.OSBINARY, 38 null, new File("which"), params );38 null, new File("which"), params, false); 39 39 } catch (IOException e) { 40 40 e.printStackTrace();
Note:
See TracChangeset
for help on using the changeset viewer.