Class JarFiles

java.lang.Object
io.smallrye.common.io.jar.JarFiles

@Deprecated(since="2.19", forRemoval=true) public class JarFiles extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
Java 9+ variant of a JDK-specific class for working with JarFiles.
  • Method Summary

    Modifier and Type
    Method
    Description
    static JarFile
    create(File file)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns an equivalent of new JarFile(file).
    static JarFile
    create(File file, boolean verify)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns an equivalent of new JarFile(file, verify).
    static JarFile
    create(String name)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns an equivalent of new JarFile(name).
    static JarFile
    create(String name, boolean verify)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns an equivalent of new JarFile(name, verify).
    static boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns true if this JarFile is a multi-release jar.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • create

      public static JarFile create(String name) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      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.
      Parameters:
      name - the file name (must not be null)
      Returns:
      an equivalent of new JarFile(name)
      Throws:
      IOException - if the operation fails
    • create

      public static JarFile create(String name, boolean verify) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      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.
      Parameters:
      name - the file name (must not be null)
      verify - true to verify the JAR signatures
      Returns:
      an equivalent of new JarFile(name, verify)
      Throws:
      IOException - if the operation fails
    • create

      public static JarFile create(File file) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      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.
      Parameters:
      file - the file (must not be null)
      Returns:
      an equivalent of new JarFile(file)
      Throws:
      IOException - if the operation fails
    • create

      public static JarFile create(File file, boolean verify) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      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.
      Parameters:
      file - the file (must not be null)
      verify - true to verify the JAR signatures
      Returns:
      an equivalent of new JarFile(file, verify)
      Throws:
      IOException - if the operation fails
    • isMultiRelease

      public static boolean isMultiRelease(JarFile jarFile)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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.
      Parameters:
      jarFile - the JAR file (must not be null)
      Returns:
      true if this JarFile is a multi-release jar