- Timestamp:
- 2019-11-28T22:17:15+13:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/gli/src/org/greenstone/gatherer/metadata/MetadataXMLFile.java
r29793 r33727 100 100 } 101 101 102 //System.err.println("MetadataXMLFile.addMetadata() Adding meta for file regexp: " 103 // + file_path_regexp + " - " + org.greenstone.gatherer.util.Utility.debugUnicodeString(file_path_regexp)); 104 102 105 // Find the appropriate FileSet element for this file 103 106 Element appropriate_fileset_element = null; … … 259 262 String current_filename_element_value = XMLTools.getElementTextValue(current_filename_element); 260 263 264 String regexed_file_relative_path = MetadataTools.getRegularExpressionThatMatchesFilePath(file_relative_path); 265 //System.err.println("Looking in meta.xml for regexed version of filename: " + regexed_file_relative_path); 266 261 267 // Does this fileset specify metadata for one file only? 262 268 is_one_file_only_metadata = true; … … 266 272 } 267 273 274 String current_filename_element_value_hex = FilenameEncoding.fileNameToHex(current_filename_element_value); 275 268 276 // This fileset specifies metadata for the file 269 if (file_relative_path.matches(current_filename_element_value)) { 277 // MetadataXMLFile.addMetadata(CollectionTreeNode, ArrayList) stored filename in uppercase hex, so need to compare with the same 278 if (file_relative_path.matches(current_filename_element_value_hex)) { //if (file_relative_path.matches(current_filename_element_value)) { 279 //System.err.println("Found a match in meta.xml for file name: " + regexed_file_relative_path); 270 280 current_fileset_matches = true; 271 281 if (!file_relative_path.equals("") && current_filename_element_value.equals(DIRECTORY_FILENAME)) { … … 273 283 } 274 284 break; 275 } 276 285 } 286 277 287 // This fileset specifies metadata for the folder the file is in 278 if ( file_relative_path.startsWith(current_filename_element_value + FilenameEncoding.URL_FILE_SEPARATOR)) {288 if (regexed_file_relative_path.startsWith(current_filename_element_value + FilenameEncoding.URL_FILE_SEPARATOR)) { 279 289 current_fileset_matches = true; 280 290 folder_metadata_inherited_from = new File(metadata_xml_file_directory, current_filename_element_value);
Note:
See TracChangeset
for help on using the changeset viewer.