corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/som/cff/FileLocator.java
changeset 37822 8b86795b49d4
parent 25862 a5e25d68f971
--- a/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/som/cff/FileLocator.java	Wed Jul 05 21:39:33 2017 +0200
+++ b/corba/src/java.corba/share/classes/com/sun/tools/corba/se/idl/som/cff/FileLocator.java	Tue May 03 09:09:14 2016 +0100
@@ -222,7 +222,8 @@
 
     /**
      * locateFileInClassPath returns a DataInputStream that can be used
-     * to read the requested file.  The CLASSPATH is used to locate the file.
+     * to read the requested file.  The resource is located in the java.corba
+     * module or if not found, then the CLASSPATH is searched.
      *
      * @param fileName The name of the file to locate.  The file name
      * may be qualified with a partial path name, using '/' as the separator
@@ -238,6 +239,12 @@
     public static DataInputStream locateFileInClassPath (String fileName)
         throws FileNotFoundException, IOException {
 
+        // The resource should be in the java.corba module
+        InputStream in = FileLocator.class.getResourceAsStream("/" + fileName);
+        if (in != null) {
+            return new DataInputStream(in);
+        }
+
         boolean notFound = true;
         StringTokenizer st;
         String path = "";