Changeset 4341


Ignore:
Timestamp:
2003-05-27T11:44:37+12:00 (21 years ago)
Author:
jmt12
Message:

New static strings used during new collection based on existing collection - John

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/util/Utility.java

    r4318 r4341  
    4848import org.w3c.dom.*;
    4949import org.xml.sax.*;
    50 /** To provide a library of common methods, in a static context, for use in the Gatherer. 
     50/** To provide a library of common methods, in a static context, for use in the Gatherer.
    5151 * @author John Thompson, Greenstone Digital Library, University of Waikato
    5252 * @version 2.3b
     
    6969     static final public String CFG_COLLECTIONMETA_COLLECTIONNAME = "collectionmeta collectionname";
    7070     static final public String CFG_COLLECTIONMETA_COLLECTIONEXTRA = "collectionmeta collectionextra";
     71     static final public String CFG_COLLECTIONMETA_ICONCOLLECTION = "collectionmeta iconcollection";
    7172     static final public String CFG_CLASSIFY = "classify";
     73     static final public String CFG_CLASSIFY_BUTTONNAME = "-buttonname";
    7274     static final public String CFG_CLASSIFY_HFILE = "-hfile";
    7375     static final public String CFG_CLASSIFY_METADATA = "-metadata";
     
    150152      * @param in_col A <i>boolean</i> indicating whether we are looking for a file within a collection of not. If <i>true</i> then the tree paths head in the collection name, and no element in the path refers to the import directory. Otherwise the paths head will be one of the system roots and all traversed file locations will exist in the path.
    151153      * @return A <strong>TreePath</strong> which traverses the file system tree to the specified file.
    152       */ 
     154      */
    153155     public static TreePath createTreePath(File file, boolean in_col) {
    154156          TreePath path = null;
     
    261263     }
    262264
    263      /** Using this method we can request that a certain document be written, as valid XML, to a certain output stream. This makes use of the Xerces Serialization suite, which should in no way be confused with the usual method of Serialization used by Java. */ 
     265     /** Using this method we can request that a certain document be written, as valid XML, to a certain output stream. This makes use of the Xerces Serialization suite, which should in no way be confused with the usual method of Serialization used by Java. */
    264266     static public boolean export(Document document, String filename) {
    265267          return export(document, new File(filename));
     
    279281                // Generate a new serializer from the above.
    280282                XMLSerializer s        = new XMLSerializer(w, f);
    281                 s.asDOMSerializer();                           
     283                s.asDOMSerializer();
    282284                // Finally serialize the document to file.
    283285                s.serialize(document);
     
    286288                return true;
    287289          }
    288           // A file not found exception is most likely thrown because the directory the metadata.xml file is attempting to be written to no longer has any files in it. I'll add a test in GDMDocument to test for this, but if it still happens ignore it (a non-existant directory can't really have metadata added to it any way. 
     290          // A file not found exception is most likely thrown because the directory the metadata.xml file is attempting to be written to no longer has any files in it. I'll add a test in GDMDocument to test for this, but if it still happens ignore it (a non-existant directory can't really have metadata added to it any way.
    289291          catch (FileNotFoundException fnf_exception) {
    290292                if(!file.getName().endsWith(METADATA_XML)) {
     
    445447                          }
    446448                     }
    447                 }           
     449                }
    448450          }
    449451          String result = line;
     
    486488          if(raw.indexOf(File.separator) == -1 && raw.startsWith("...")) {
    487489                raw = raw.substring(3);
    488           } 
     490          }
    489491          return raw;
    490492     }
     
    770772          Document document = null;
    771773          try {
    772                 FileInputStream fis   = new FileInputStream(file); 
     774                FileInputStream fis   = new FileInputStream(file);
    773775                InputStreamReader isr = new InputStreamReader(fis);
    774776                Reader r              = new BufferedReader(isr);
     
    790792                fis = null;
    791793                file = null;
    792           } 
     794          }
    793795          catch (Exception error) {
    794796                if(noisey) {
     
    898900                roots[i] = (File)valid.get(i);
    899901          }
    900           return roots;     
     902          return roots;
    901903     }
    902904}
Note: See TracChangeset for help on using the changeset viewer.