Interface JarArchive

    • Method Detail

      • containsClass

        boolean containsClass​(String className)
                       throws IOException
        Returns whether a class of the specified name is contained in the archive.
        Parameters:
        className - The name of the class to search for
        Returns:
        Whether the class was found
        Throws:
        IOException - If an I/O error occurred reading the archive
      • findResource

        String findResource​(String name)
                     throws IOException
        Returns the full path of a named resource in the archive.
        Parameters:
        name - The name of the resource
        Returns:
        The full path to the resource inside the archive
        Throws:
        IOException - If an I/O error occurred reading the archive
      • getResource

        InputStream getResource​(String path)
                         throws IOException
        Returns a resource from the archive as input stream.
        Parameters:
        path - The path to the resource in the archive
        Returns:
        An input stream containing the specified resource, or null if the resource was not found in the JAR
        Throws:
        IOException - If an I/O error occurs
      • getResources

        List<String> getResources​(String path)
                           throws IOException
        Returns the list of resources in the specified directory in the archive.
        Parameters:
        path - The directory
        Returns:
        The list of resources
        Throws:
        IOException - If an I/O error occurs
      • expandToPath

        void expandToPath​(String path)
                   throws IOException
        Expand the archive to the specified directory.
        Parameters:
        path - The path to expand to
        Throws:
        IOException - If an I/O error occurs
      • expandToPath

        void expandToPath​(String path,
                          FileFilter filter)
                   throws IOException
        Expand the archive to the specified directory, filtering out files.
        Parameters:
        path - The path to expand to
        filter - The filter to use
        Throws:
        IOException - If an I/O error occurs