### Eclipse Workspace Patch 1.0 #P drools Index: drools-io/src/main/org/drools/io/RuleSetReader.java =================================================================== RCS file: /home/projects/drools/scm/drools/drools-io/src/main/org/drools/io/RuleSetReader.java,v retrieving revision 1.54 diff -u -r1.54 RuleSetReader.java --- drools-io/src/main/org/drools/io/RuleSetReader.java 6 Jan 2006 13:35:23 -0000 1.54 +++ drools-io/src/main/org/drools/io/RuleSetReader.java 15 Mar 2006 22:01:04 -0000 @@ -39,6 +39,7 @@ */ import java.io.BufferedInputStream; +import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; @@ -982,56 +983,63 @@ } // Try looking in META-INF - try { - return new InputSource(cl.getResourceAsStream("META-INF/" + xsd)); - } catch (Exception e) { + { + InputStream is = cl.getResourceAsStream("META-INF/" + xsd); + if(is != null) { + return new InputSource(is); + } } // Try looking in /META-INF - try { - return new InputSource(cl.getResourceAsStream("/META-INF/" + xsd)); - } catch (Exception e) { + { + InputStream is = cl.getResourceAsStream("/META-INF/" + xsd); + if(is != null) { + return new InputSource(is); + } } // Try looking at root of classpath - try { - return new InputSource(cl.getResourceAsStream("/" + xsd)); - } catch (Exception e) { + { + InputStream is = cl.getResourceAsStream("/" + xsd); + if(is != null) { + return new InputSource(is); + } } // Try current working directory - try { - return new InputSource(new BufferedInputStream(new FileInputStream( - xsd))); - } catch (Exception e) { + { + File file = new File(xsd); + if(file.exists()) { + return new InputSource(new BufferedInputStream(new FileInputStream(file))); + } } cl = ClassLoader.getSystemClassLoader(); // Try looking in META-INF - try { - return new InputSource(cl.getResourceAsStream("META-INF/" + xsd)); - } catch (Exception e) { + { + InputStream is = cl.getResourceAsStream("META-INF/" + xsd); + if(is != null) { + return new InputSource(is); + } } // Try looking in /META-INF - try { - return new InputSource(cl.getResourceAsStream("/META-INF/" + xsd)); - } catch (Exception e) { + { + InputStream is = cl.getResourceAsStream("/META-INF/" + xsd); + if(is != null) { + return new InputSource(is); + } } // Try looking at root of classpath - try { - return new InputSource(cl.getResourceAsStream("/" + xsd)); - } catch (Exception e) { + { + InputStream is = cl.getResourceAsStream("/" + xsd); + if(is != null) { + return new InputSource(is); + } } - // Try current working directory - try { - return new InputSource(new BufferedInputStream(new FileInputStream( - xsd))); - } catch (Exception e) { - } return null; }