Ignore:
Timestamp:
2009-01-12T11:19:23+13:00 (15 years ago)
Author:
kjdon
Message:

updated the rtl-gli branch with files from trunk. Result of a merge 14807:18318

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gli/branches/rtl-gli/src/org/greenstone/gatherer/metadata/DocXMLFileManager.java

    r13337 r18362  
    6060
    6161
    62     static public void loadDocXMLFiles(File directory)
     62    static public void loadDocXMLFiles(File directory, String filename_match)
    6363    {
    6464    // Make sure the directory (archives) exists
     
    7272        File child_file = directory_files[i];
    7373        if (child_file.isDirectory()) {
    74         loadDocXMLFiles(child_file);
     74        loadDocXMLFiles(child_file,filename_match);
    7575        }
    76         else if (child_file.getName().equals("doc.xml")) {
    77         loadDocXMLFile(child_file);
     76        else if (child_file.getName().equals(filename_match)) {
     77        // e.g. doc.xml (for regular Greenstone, docmets.xml for Fedora)
     78
     79        loadDocXMLFile(child_file,filename_match);
    7880        }
    7981    }
     
    8183
    8284
    83     static private void loadDocXMLFile(File doc_xml_file_file)
     85    static private void loadDocXMLFile(File doc_xml_file_file,String filename_match)
    8486    {
    85     DocXMLFile doc_xml_file = new DocXMLFile(doc_xml_file_file.getAbsolutePath());
    86     try {
     87    String file = doc_xml_file_file.getAbsolutePath();
     88
     89    // Need to do typecasts in the following to keep Java 1.4 happy
     90    DocXMLFile doc_xml_file
     91        = (filename_match.equals("docmets.xml"))
     92        ? (DocXMLFile) new DocMetsXMLFile(file)
     93        : (DocXMLFile) new DocGAFile(file);
     94
     95    try {       
    8796        doc_xml_file.skimFile();
    8897        doc_xml_files.add(doc_xml_file);
Note: See TracChangeset for help on using the changeset viewer.