- Timestamp:
- 2004-10-08T09:46:12+13:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/msm/MetadataXMLFile.java
r7624 r8236 29 29 import java.io.*; 30 30 import java.util.*; 31 import org.greenstone.gatherer.DebugStream; 31 32 import org.greenstone.gatherer.Gatherer; 32 33 import org.greenstone.gatherer.msm.MetadataXMLFileManager; … … 184 185 } 185 186 catch (Exception error) { 186 Gatherer.printStackTrace(error);187 DebugStream.printStackTrace(error); 187 188 } 188 189 } … … 190 191 /** this is used to 'purge' the metadata - I've taken the purge code out of getMetadata and put it in to here, cos its only called from one place and we dont want to retrieve the metadata, just update it */ 191 192 public void cleanUpMetadataRefs() { 192 // Gatherer.println("clean up metadata refs!");193 //DebugStream.println("clean up metadata refs!"); 193 194 194 195 String file_relative_path = ""; … … 208 209 // If this raw_value contains a '\' character, but no '\\', '[' or ']' characters, then replace the '\' with a '\\' 209 210 if(raw_value.indexOf(StaticStrings.ESCAPE_STR) != -1) { 210 Gatherer.println("Detected Legacy Path: " + raw_value);211 DebugStream.println("Detected Legacy Path: " + raw_value); 211 212 raw_value = raw_value.replaceAll(StaticStrings.ESCAPE_PATTERN, StaticStrings.PIPE_STR); 212 213 MSMUtils.setValue(metadata_element, raw_value); … … 231 232 metadata_elements = null; 232 233 } // for each metadata type 233 } catch (Exception e rror) {234 Gatherer.self.printStackTrace(error);234 } catch (Exception exception) { 235 DebugStream.printStackTrace(exception); 235 236 } 236 237 } … … 279 280 // Kath has cleaned up this version a bit 280 281 public ArrayList getMetadata(String filename, boolean remove, ArrayList metadatum_so_far, File file, boolean append_folder_level) { 281 Gatherer.println("Get metadata for " + filename);282 Gatherer.println("remove = " + remove + ", metadata_so_far = " + (metadatum_so_far != null ? String.valueOf(metadatum_so_far.size()) : "null") + ", file = " + file + ", append_folder_level = " + append_folder_level);282 DebugStream.println("Get metadata for " + filename); 283 DebugStream.println("remove = " + remove + ", metadata_so_far = " + (metadatum_so_far != null ? String.valueOf(metadatum_so_far.size()) : "null") + ", file = " + file + ", append_folder_level = " + append_folder_level); 283 284 284 285 // Determine the file's path relative to the location of the metadata.xml file … … 335 336 // If this raw_value contains a '\' character, but no '\\', '[' or ']' characters, then replace the '\' with a '\\' 336 337 if(raw_value.indexOf(StaticStrings.ESCAPE_STR) != -1) { 337 Gatherer.println("Detected Legacy Path: " + raw_value);338 DebugStream.println("Detected Legacy Path: " + raw_value); 338 339 raw_value = raw_value.replaceAll(StaticStrings.ESCAPE_PATTERN, StaticStrings.PIPE_STR); 339 Gatherer.println("Updated Path To: " + raw_value);340 DebugStream.println("Updated Path To: " + raw_value); 340 341 MSMUtils.setValue(metadata_element, raw_value); 341 342 } … … 454 455 directorymetadata_element = null; 455 456 } 456 catch (Exception e rror) {457 Gatherer.self.printStackTrace(error);457 catch (Exception exception) { 458 DebugStream.printStackTrace(exception); 458 459 } 459 460 ///ystem.err.println("Found " + metadatum.size() + " pieces of metadata."); … … 480 481 } 481 482 catch (Exception error) { 482 Gatherer.printStackTrace(error);483 DebugStream.printStackTrace(error); 483 484 } 484 485 return has_meta; … … 523 524 } 524 525 catch(Exception exception) { 525 Gatherer.println("Exception in MetadataXMLFile.removeExtractedMetadata() - unexpected");526 Gatherer.printStackTrace(exception);526 DebugStream.println("Exception in MetadataXMLFile.removeExtractedMetadata() - unexpected"); 527 DebugStream.printStackTrace(exception); 527 528 } 528 529 } … … 530 531 /** Remove the given metadata from this document.If filename is null, then removes directory level metadata, otherwise just removes it from the specified file. All directory level metadata is available under the FileSet with filename '.*'. There is at least one nasty case to consider, where the first overwriting metadata entry, of several with the same element, is removed. In this case the next entry must become overwrite to ensure proper inheritance. */ 531 532 public void removeMetadata(String filename, Metadata metadata) { 532 Gatherer.println("Remove metadata: " + metadata + "\nFrom filename: " + filename);533 DebugStream.println("Remove metadata: " + metadata + "\nFrom filename: " + filename); 533 534 try { 534 535 boolean found = false; … … 619 620 } 620 621 catch (Exception error) { 621 Gatherer.printStackTrace(error);622 DebugStream.printStackTrace(error); 622 623 } 623 624 }
Note:
See TracChangeset
for help on using the changeset viewer.