Changeset 5979
- Timestamp:
- 2003-11-25T16:08:35+13:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl3/src/java/org/greenstone/gsdl3/util/GSEntityResolver.java
r5962 r5979 10 10 public class GSEntityResolver implements EntityResolver { 11 11 12 //public GSEntityResolver() {13 ///ystem.out.println("creating entity resolver");14 //}15 12 public InputSource resolveEntity (String public_id, String system_id) { 16 13 17 14 System.out.println("entity resolver for "+system_id); 18 if (system_id.endsWith(".dtd") && system_id.indexOf("jakarta")!=-1) { 19 int index = system_id.lastIndexOf(File.separatorChar); 20 if (index != -1) { 21 system_id = system_id.substring(index+1); 22 15 String temp_id = system_id; 16 if (temp_id.startsWith("file://")) { 17 File f = new File(system_id); 18 if (f.exists()) { 19 return new InputSource(system_id); 20 } else { 21 temp_id = temp_id.substring(temp_id.lastIndexOf(File.separator)+1); 23 22 } 24 } else if (system_id.endsWith(".dtd") && system_id.indexOf(File.separatorChar)==-1) {25 26 23 } else { 27 return null; 24 if (temp_id.indexOf(File.separatorChar)!= -1) { 25 temp_id = temp_id.substring(temp_id.lastIndexOf(File.separator)+1); 26 } 28 27 } 29 System.out.println("using class loader for "+system_id); 30 URL url = ClassLoader.getSystemResource(system_id); 28 29 System.out.println("using class loader for "+temp_id); 30 URL url = ClassLoader.getSystemResource(temp_id); 31 31 if (url == null) { 32 32 System.out.println("class loader didn't find it"); … … 35 35 return new InputSource("file://"+url.getFile()); 36 36 } 37 37 38 }
Note:
See TracChangeset
for help on using the changeset viewer.