< prev index next >

src/java.base/share/classes/jdk/internal/jmod/JmodFile.java

Print this page

        

@@ -184,11 +184,11 @@
      * or {@code null} if not found.
      */
     public Entry getEntry(Section section, String name) {
         String entry = section.jmodDir() + "/" + name;
         ZipEntry ze = zipfile.getEntry(entry);
-        return (ze != null) ? new Entry(ze) : null;
+        return (ze == null || ze.isDirectory()) ? null : new Entry(ze);
     }
 
     /**
      * Opens an {@code InputStream} for reading the named entry of the given
      * section in this jmod file.

@@ -199,11 +199,11 @@
     public InputStream getInputStream(Section section, String name)
         throws IOException
     {
         String entry = section.jmodDir() + "/" + name;
         ZipEntry e = zipfile.getEntry(entry);
-        if (e == null) {
+        if (e == null || e.isDirectory()) {
             throw new IOException(name + " not found: " + file);
         }
         return zipfile.getInputStream(e);
     }
 
< prev index next >