Changeset 6795 for trunk/gli/src/org/greenstone/gatherer/file
- Timestamp:
- 2004-02-12T17:05:28+13:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/file/FileAssociationManager.java
r6786 r6795 45 45 static final private String ESCAPE = "\\\\"; // '\' 46 46 static final private String ESCAPED_ESCAPE = "\\\\\\\\"; // '\\' 47 static final private String SPACE = " "; 48 static final private String ESCAPED_SPACE = "\\\\ "; 47 49 private Element associations_element; 48 50 private File data_file; … … 165 167 } 166 168 167 public String getCommand(File file) {169 public String [] getCommand(File file) { 168 170 String command = null; 171 String [] commands = null; 169 172 if(file.isFile()) { 170 173 // Determine extension … … 220 223 } 221 224 if(command != null) { 225 // Make the command into a string [] just in case the filename has spaces in it 226 commands = command.split(" "); 227 222 228 // We have to fix filename under windows to escape the backslashes. 223 229 filename = filename.replaceAll(ESCAPE, ESCAPED_ESCAPE); 224 230 // Replace %1 with the appropriate filename 225 command = command.replaceAll(FILENAME_ARG, filename); 231 for(int i=0; i<commands.length; i++) { 232 if (commands[i].equals(FILENAME_ARG)) { 233 commands[i] = filename; 234 } 235 } 236 //command = command.replaceAll(FILENAME_ARG, filename); 226 237 } 227 238 … … 230 241 filename = null; 231 242 } 232 return command ;243 return commands; 233 244 } 234 245
Note:
See TracChangeset
for help on using the changeset viewer.