< prev index next >

src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/ModFile.java

Print this page

        

*** 21,31 **** * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ ! package jdk.jpackage.internal; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; --- 21,31 ---- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ ! package jdk.incubator.jpackage.internal; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException;
*** 95,123 **** } private static JarType isModularJar(String FileName) { JarType result = JarType.All; ! try { ! ZipInputStream zip = ! new ZipInputStream(new FileInputStream(FileName)); result = JarType.UnnamedJar; - try { for (ZipEntry entry = zip.getNextEntry(); entry != null; entry = zip.getNextEntry()) { if (entry.getName().matches("module-info.class")) { result = JarType.ModularJar; break; } } - - zip.close(); } catch (IOException ex) { } - } catch (FileNotFoundException e) { - } return result; } private static String getFileWithoutExtension(String FileName) { --- 95,117 ---- } private static JarType isModularJar(String FileName) { JarType result = JarType.All; ! try (ZipInputStream zip = ! new ZipInputStream(new FileInputStream(FileName))) { result = JarType.UnnamedJar; for (ZipEntry entry = zip.getNextEntry(); entry != null; entry = zip.getNextEntry()) { if (entry.getName().matches("module-info.class")) { result = JarType.ModularJar; break; } } } catch (IOException ex) { } return result; } private static String getFileWithoutExtension(String FileName) {
< prev index next >