Changeset 34265
- Timestamp:
- 2020-07-12T13:25:34+12:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/gli/src/org/greenstone/gatherer/metadata/MetadataToCSV.java
r34264 r34265 46 46 import org.apache.commons.csv.*; 47 47 48 import org.greenstone.gatherer.util.SafeProcess;49 48 import org.greenstone.gatherer.DebugStream; 50 49 import org.greenstone.gatherer.Dictionary; … … 52 51 import org.greenstone.gatherer.metadata.MetadataValue; 53 52 import org.greenstone.gatherer.metadata.MetadataXMLFileManager; 54 53 import org.greenstone.gatherer.util.SafeProcess; 54 import org.greenstone.gatherer.util.Utility; 55 55 56 56 … … 116 116 return fullPath; 117 117 } else { 118 return fullPath.substring(indexMatch+import_path_length); 118 fullPath = fullPath.substring(indexMatch+import_path_length); 119 // MetadataCSVPlugin wants URL style slashes (forward slashes) not Windows backslashes 120 // as file separator. But on Linux, backslashes have a different meaning in filepaths, 121 // so must only replace \ with / if we're on Windows. 122 if(Utility.isWindows()) { 123 fullPath = fullPath.replace("\\", "/"); 124 } 125 return fullPath; 119 126 } 120 127 } … … 426 433 String filename = field; 427 434 // TODO: filenames are stored relative to import folder, convert to full path for internal use? 435 // Relative filepaths are stored with URL style slashes not OS specific slashes 436 // For Windows, reconvert to \ 437 //File fullPathFile = new File(coll_importdir_path, filename); // would this work to 438 // create OS specific paths, even if filename has slashes the wrong way round for Windows? 439 if(Utility.isWindows()) { 440 filename = filename.replace("/", "\\"); 441 } 428 442 File fullPathFile = new File(coll_importdir_path + filename); 429 443 ///System.err.println("Found Filename meta: " + filename);
Note:
See TracChangeset
for help on using the changeset viewer.