Ignore:
Timestamp:
2004-10-08T09:46:12+13:00 (20 years ago)
Author:
mdewsnip
Message:

Replaced all Gatherer.print* with DebugStream.print*.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/msm/MetadataXMLFile.java

    r7624 r8236  
    2929import java.io.*;
    3030import java.util.*;
     31import org.greenstone.gatherer.DebugStream;
    3132import org.greenstone.gatherer.Gatherer;
    3233import org.greenstone.gatherer.msm.MetadataXMLFileManager;
     
    184185    }
    185186    catch (Exception error) {
    186         Gatherer.printStackTrace(error);
     187        DebugStream.printStackTrace(error);
    187188    }
    188189    }
     
    190191    /** 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 */
    191192    public void cleanUpMetadataRefs() {
    192     //Gatherer.println("clean up metadata refs!");
     193    //DebugStream.println("clean up metadata refs!");
    193194
    194195    String file_relative_path = "";
     
    208209            // If this raw_value contains a '\' character, but no '\\', '[' or ']' characters, then replace the '\' with a '\\'
    209210            if(raw_value.indexOf(StaticStrings.ESCAPE_STR) != -1) {
    210             Gatherer.println("Detected Legacy Path: " + raw_value);
     211            DebugStream.println("Detected Legacy Path: " + raw_value);
    211212            raw_value = raw_value.replaceAll(StaticStrings.ESCAPE_PATTERN, StaticStrings.PIPE_STR);
    212213            MSMUtils.setValue(metadata_element, raw_value);
     
    231232        metadata_elements = null;
    232233        } // for each metadata type
    233     } catch (Exception error) {
    234         Gatherer.self.printStackTrace(error);
     234    } catch (Exception exception) {
     235        DebugStream.printStackTrace(exception);
    235236    }
    236237    }
     
    279280    // Kath has cleaned up this version a bit
    280281    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);
    283284
    284285    // Determine the file's path relative to the location of the metadata.xml file
     
    335336            // If this raw_value contains a '\' character, but no '\\', '[' or ']' characters, then replace the '\' with a '\\'
    336337            if(raw_value.indexOf(StaticStrings.ESCAPE_STR) != -1) {
    337                 Gatherer.println("Detected Legacy Path: " + raw_value);
     338                DebugStream.println("Detected Legacy Path: " + raw_value);
    338339                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);
    340341                MSMUtils.setValue(metadata_element, raw_value);
    341342            }
     
    454455        directorymetadata_element = null;
    455456    }
    456     catch (Exception error) {
    457         Gatherer.self.printStackTrace(error);
     457    catch (Exception exception) {
     458        DebugStream.printStackTrace(exception);
    458459    }
    459460    ///ystem.err.println("Found " + metadatum.size() + " pieces of metadata.");
     
    480481    }
    481482    catch (Exception error) {
    482         Gatherer.printStackTrace(error);
     483        DebugStream.printStackTrace(error);
    483484    }
    484485    return has_meta;
     
    523524    }
    524525    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);
    527528    }
    528529    }
     
    530531    /** 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. */
    531532    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);
    533534    try {
    534535        boolean found = false;
     
    619620    }
    620621    catch (Exception error) {
    621         Gatherer.printStackTrace(error);
     622        DebugStream.printStackTrace(error);
    622623    }
    623624    }
Note: See TracChangeset for help on using the changeset viewer.