Changeset 10006 for trunk/gli/src/org/greenstone/gatherer/util
- Timestamp:
- 2005-06-03T14:36:41+12:00 (19 years ago)
- Location:
- trunk/gli/src/org/greenstone/gatherer/util
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/util/StaticStrings.java
r9906 r10006 191 191 static final public String PLUGIN_STR = "plugin"; 192 192 static final public String PROPERTIES_FILE_EXTENSION = ".properties"; 193 static final public String PSEUDO_COLLECTCONFIGURATION_XML = "xml/CollectionConfig.xml";194 193 static final public String RANGE_ELEMENT = "Range"; 195 194 static final public String RBRACKET_CHARACTER = "]"; -
trunk/gli/src/org/greenstone/gatherer/util/Utility.java
r9981 r10006 1037 1037 1038 1038 1039 /** Parse in a xml document from a given filename. Note that this filename may need to be resolved by the class loader, especially for template files within a jar. */1040 static public Document parse(String filename, boolean use_classloader)1041 {1042 // Try the class loader if desired (for the applet JAR file)1043 if (use_classloader) {1044 InputStream is = base.getResourceAsStream("/" + filename);1045 if (is != null) {1046 return XMLTools.parseXML(is);1047 }1048 }1049 1050 // Try the file outside the classes directory1051 return XMLTools.parseXMLFile(new File(filename));1052 }1053 1054 1055 1039 static public StringBuffer readXMLStream(InputStream input_stream) 1056 1040 { -
trunk/gli/src/org/greenstone/gatherer/util/XMLTools.java
r9856 r10006 96 96 } 97 97 return child; 98 } 99 100 101 /** Parse an XML document from a given file path */ 102 static public Document parseXMLFile(String xml_file_path, boolean use_class_loader) 103 { 104 if (use_class_loader == true) { 105 InputStream is = Utility.base.getResourceAsStream("/" + xml_file_path); // !! 106 if (is != null) { 107 return parseXML(is); 108 } 109 } 110 111 // Try the file outside the classes directory 112 return parseXMLFile(new File(xml_file_path)); 98 113 } 99 114
Note:
See TracChangeset
for help on using the changeset viewer.