Class JarFiles


  • public class JarFiles
    extends Object
    Java 9+ variant of a JDK-specific class for working with JarFiles.
    • Constructor Detail

      • JarFiles

        public JarFiles()
    • Method Detail

      • create

        public static JarFile create​(String name)
                              throws IOException
        Returns an equivalent of new JarFile(name). On Java 8, that's exactly what is returned. On Java 9+, an equivalent that is multi-release-enabled is returned.
        Throws:
        IOException
      • create

        public static JarFile create​(String name,
                                     boolean verify)
                              throws IOException
        Returns an equivalent of new JarFile(name, verify). On Java 8, that's exactly what is returned. On Java 9+, an equivalent that is multi-release-enabled is returned.
        Throws:
        IOException
      • create

        public static JarFile create​(File file)
                              throws IOException
        Returns an equivalent of new JarFile(file). On Java 8, that's exactly what is returned. On Java 9+, an equivalent that is multi-release-enabled is returned.
        Throws:
        IOException
      • create

        public static JarFile create​(File file,
                                     boolean verify)
                              throws IOException
        Returns an equivalent of new JarFile(file, verify). On Java 8, that's exactly what is returned. On Java 9+, an equivalent that is multi-release-enabled is returned.
        Throws:
        IOException
      • isMultiRelease

        public static boolean isMultiRelease​(JarFile jarFile)
        Returns true if this JarFile is a multi-release jar. On Java 8 this is done by browsing the manifest. On Java 9+, there is a isMultiRelease method