Ignore:
Timestamp:
2008-08-26T17:23:26+12:00 (16 years ago)
Author:
davidb
Message:

Generalisation of skimming doc.xml files to find extracted metadata. Can now read docmets.xml files in export folder instead of doc.xml in archives folder.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gli/trunk/src/org/greenstone/gatherer/metadata/DocXMLFileManager.java

    r13337 r17009  
    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    DocXMLFile doc_xml_file
     90        = (filename_match.equals("docmets.xml")) ? new DocMetsXMLFile(file) : new DocGAFile(file);
     91
     92    try {       
    8793        doc_xml_file.skimFile();
    8894        doc_xml_files.add(doc_xml_file);
Note: See TracChangeset for help on using the changeset viewer.