Class JarInspector


  • public class JarInspector
    extends java.lang.Object
    A wrapper around the Java zip utilities to inspect Jar archives
    Author:
    Ben Holland
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String META_INF
      The directory that stores the manifest and jar signatures
      static java.lang.String SEPERATOR
      The directory separator character for archive files as a string
    • Constructor Summary

      Constructors 
      Constructor Description
      JarInspector​(java.io.File jarFile)
      Creates a new JarModifier with the given archive to be modified
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      byte[] extractEntry​(java.lang.String entry)  
      java.util.HashSet<java.lang.String> getJarEntrySet()  
      java.io.File getJarFile()  
      java.util.jar.Manifest getManifest()
      Returns the parsed manifest or null if there is no manifest
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • SEPERATOR

        public static final java.lang.String SEPERATOR
        The directory separator character for archive files as a string
        See Also:
        Constant Field Values
      • META_INF

        public static final java.lang.String META_INF
        The directory that stores the manifest and jar signatures
        See Also:
        Constant Field Values
    • Constructor Detail

      • JarInspector

        public JarInspector​(java.io.File jarFile)
                     throws java.util.jar.JarException,
                            java.io.IOException
        Creates a new JarModifier with the given archive to be modified
        Parameters:
        jarFile - The archive to be modified.
        Throws:
        java.util.jar.JarException
        java.io.IOException
    • Method Detail

      • getJarFile

        public java.io.File getJarFile()
      • extractEntry

        public byte[] extractEntry​(java.lang.String entry)
                            throws java.io.IOException
        Throws:
        java.io.IOException
      • getManifest

        public java.util.jar.Manifest getManifest()
        Returns the parsed manifest or null if there is no manifest
        Returns:
      • getJarEntrySet

        public java.util.HashSet<java.lang.String> getJarEntrySet()