Class JarIndexer


  • public class JarIndexer
    extends Object
    Class which contains utility methods to create an index for a jar file
    Author:
    Stuart Douglas, Jason T. Greene, Ales Justin
    • Method Detail

      • createJarIndex

        public static Result createJarIndex​(File jarFile,
                                            Indexer indexer,
                                            boolean modify,
                                            boolean newJar,
                                            boolean verbose)
                                     throws IOException
        Indexes a jar file and saves the result. If the modify flag is set, index is saved to META-INF/jandex.idx. Otherwise an external file is created with a similar name to the original file, concatenating .idx suffix.
        Parameters:
        jarFile - The file to index
        indexer - The indexer to use
        modify - If the original jar should be modified
        newJar - If the new jar should be created
        verbose - If we should print what we are doing to standard out
        Returns:
        indexing result
        Throws:
        IOException - for any I/o error
      • createJarIndex

        public static Result createJarIndex​(File jarFile,
                                            Indexer indexer,
                                            File outputFile,
                                            boolean modify,
                                            boolean newJar,
                                            boolean verbose)
                                     throws IOException
        Indexes a jar file and saves the result. If the modify flag is set, index is saved to META-INF/jandex.idx. Otherwise an external file is created with a similar name to the original file, concatenating .idx suffix.
        Parameters:
        jarFile - The file to index
        indexer - The indexer to use
        outputFile - The index file to write to
        modify - If the original jar should be modified
        newJar - If the new jar should be created
        verbose - If we should print what we are doing to standard out
        Returns:
        indexing result
        Throws:
        IOException - for any I/o error
      • createJarIndex

        public static Result createJarIndex​(File jarFile,
                                            Indexer indexer,
                                            boolean modify,
                                            boolean newJar,
                                            boolean verbose,
                                            PrintStream infoStream,
                                            PrintStream errStream)
                                     throws IOException
        Indexes a jar file and saves the result. If the modify flag is set, index is saved to META-INF/jandex.idx. Otherwise an external file is created with a similar name to the original file, concatenating .idx suffix.
        Parameters:
        jarFile - The file to index
        indexer - The indexer to use
        modify - If the original jar should be modified
        newJar - If the new jar should be created
        verbose - If we should print what we are doing to the specified info stream
        infoStream - A print stream which will record verbose info, may be null
        errStream - A print stream to print errors, must not be null
        Returns:
        indexing result
        Throws:
        IOException - for any I/o error
      • createJarIndex

        public static Result createJarIndex​(File jarFile,
                                            Indexer indexer,
                                            File outputFile,
                                            boolean modify,
                                            boolean newJar,
                                            boolean verbose,
                                            PrintStream infoStream,
                                            PrintStream errStream)
                                     throws IOException
        Indexes a jar file and saves the result. If the modify flag is set, index is saved to META-INF/jandex.idx. Otherwise an external file is created with a similar name to the original file, concatenating .idx suffix.
        Parameters:
        jarFile - The file to index
        indexer - The indexer to use
        outputFile - The index file to write to
        modify - If the original jar should be modified
        newJar - If the new jar should be created
        verbose - If we should print what we are doing to the specified info stream
        infoStream - A print stream which will record verbose info, may be null 1
        errStream - A print stream to print errors, must not be null
        Returns:
        indexing result
        Throws:
        IOException - for any I/o error