|
From: <pat...@us...> - 2009-09-05 23:45:36
|
Revision: 946
http://cishell.svn.sourceforge.net/cishell/?rev=946&view=rev
Author: pataphil
Date: 2009-09-05 23:45:29 +0000 (Sat, 05 Sep 2009)
Log Message:
-----------
Very minor code cleanup/refactoring.
Modified Paths:
--------------
trunk/templates/org.cishell.templates/src/org/cishell/templates/staticexecutable/StaticExecutableRunner.java
Modified: trunk/templates/org.cishell.templates/src/org/cishell/templates/staticexecutable/StaticExecutableRunner.java
===================================================================
--- trunk/templates/org.cishell.templates/src/org/cishell/templates/staticexecutable/StaticExecutableRunner.java 2009-09-04 21:08:26 UTC (rev 945)
+++ trunk/templates/org.cishell.templates/src/org/cishell/templates/staticexecutable/StaticExecutableRunner.java 2009-09-05 23:45:29 UTC (rev 946)
@@ -106,7 +106,6 @@
tempDirPath = makeTempDirectory();
algDirPath = tempDirPath + File.separator + props.getProperty("Algorithm-Directory") + File.separator;
-
}
/**
@@ -194,15 +193,18 @@
}
}
- protected File[] executeProgram(String[] cmdarray, String baseDirPath) throws AlgorithmExecutionException {
- //remember which files were in the directory before we ran the program
+ protected File[] executeProgram(String[] commandArray, String baseDirPath) throws AlgorithmExecutionException {
+ /*
+ * Remember which files were in the directory before we ran
+ * the program.
+ */
File baseDir = new File(baseDirPath);
String[] beforeFiles = baseDir.list();
//create and run the executing process
Process process = null;
try {
- process = Runtime.getRuntime().exec(cmdarray, null, new File(baseDirPath));
+ process = Runtime.getRuntime().exec(commandArray, null, new File(baseDirPath));
process.getOutputStream().close();
} catch (IOException e1) {
throw new AlgorithmExecutionException(e1.getMessage(), e1);
@@ -440,13 +442,15 @@
str = str.replaceAll("\\$\\{executable\\}", props.getProperty("executable"));
for (int i = 0; i < data.length; i++) {
- String file = ((File) data[i].getData()).getAbsolutePath();
+ File inFile = (File)data[i].getData();
+ String filePath = inFile.getAbsolutePath();
+ System.err.println("inFile[" + i + "]: \"" + filePath + "\" exists: " + inFile.exists());
if (File.separatorChar == '\\') {
- file = file.replace(File.separatorChar, '/');
+ filePath = filePath.replace(File.separatorChar, '/');
}
- str = str.replaceAll("\\$\\{inFile\\[" + i + "\\]\\}", file);
+ str = str.replaceAll("\\$\\{inFile\\[" + i + "\\]\\}", filePath);
if (File.separatorChar == '\\') {
str = str.replace('/', File.separatorChar);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|