Changeset 8021
- Timestamp:
- 2004-08-20T16:31:40+12:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/metadata/DocXMLFile.java
r7978 r8021 26 26 27 27 // Parse the doc.xml file 28 System.err.println("Loading doc.xml file " + doc_xml_file_path + "..."); 28 29 Document document = XMLTools.parseXMLFile(this); 29 30 if (document == null) { … … 59 60 if (metadata_element_name_full.equals("gsdlsourcefilename")) { 60 61 gsdlsourcefilename_value = XMLTools.getElementTextValue(current_metadata_element); 61 boolean is_unix_path = gsdlsourcefilename_value.startsWith("/");62 62 63 63 // We're only interested in the path relative to the import folder 64 64 int import_index = gsdlsourcefilename_value.indexOf("import"); 65 65 if (import_index != -1) { 66 gsdlsourcefilename_value = gsdlsourcefilename_value.substring(import_index + "import".length() + 1); 66 gsdlsourcefilename_value = gsdlsourcefilename_value.substring(import_index + "import".length()); 67 68 boolean is_unix_path = gsdlsourcefilename_value.startsWith("/"); 69 gsdlsourcefilename_value = gsdlsourcefilename_value.substring(1); 70 71 // Make sure the path matches the OS that is running 72 if (is_unix_path && Utility.isWindows()) { 73 // Convert path from Unix to Windows 74 gsdlsourcefilename_value = gsdlsourcefilename_value.replaceAll("/", File.separator); 75 } 76 if (!is_unix_path && !Utility.isWindows()) { 77 // Convert path from Windows to Unix 78 gsdlsourcefilename_value = gsdlsourcefilename_value.replaceAll("\\", File.separator); 79 } 67 80 } 68 69 // Make sure the path matches the OS that is running 70 if (is_unix_path && Utility.isWindows()) { 71 // Convert path from Unix to Windows 72 gsdlsourcefilename_value = gsdlsourcefilename_value.replaceAll("/", File.separator); 81 else { 82 // We don't really know what is going on... 83 System.err.println("Warning: Could not understand gsdlsourcefilename " + gsdlsourcefilename_value); 73 84 } 74 if (!is_unix_path && !Utility.isWindows()) {75 // Convert path from Windows to Unix76 gsdlsourcefilename_value = gsdlsourcefilename_value.replaceAll("\\", File.separator);77 }78 79 System.err.println("gsdlsourcefilename: " + gsdlsourcefilename_value);80 85 } 81 86
Note:
See TracChangeset
for help on using the changeset viewer.