Package org.jboss.jandex
Class JarIndexer
java.lang.Object
org.jboss.jandex.JarIndexer
Class which contains utility methods to create an index for a jar file
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static void
private static void
copy
(InputStream in, OutputStream out) static Result
createJarIndex
(File jarFile, Indexer indexer, boolean modify, boolean newJar, boolean verbose) Indexes a jar file and saves the result.static Result
createJarIndex
(File jarFile, Indexer indexer, boolean modify, boolean newJar, boolean verbose, PrintStream infoStream, PrintStream errStream) Indexes a jar file and saves the result.static Result
createJarIndex
(File jarFile, Indexer indexer, File outputFile, boolean modify, boolean newJar, boolean verbose) Indexes a jar file and saves the result.static Result
createJarIndex
(File jarFile, Indexer indexer, File outputFile, boolean modify, boolean newJar, boolean verbose, PrintStream infoStream, PrintStream errStream) Indexes a jar file and saves the result.private static File
getIndexFile
(File jarFile, boolean newJar) private static void
printIndexEntryInfo
(ClassSummary info, PrintStream infoStream) private static void
private static void
-
Constructor Details
-
JarIndexer
private JarIndexer()
-
-
Method Details
-
getIndexFile
-
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 indexindexer
- The indexer to usemodify
- If the original jar should be modifiednewJar
- If the new jar should be createdverbose
- 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 indexindexer
- The indexer to useoutputFile
- The index file to write tomodify
- If the original jar should be modifiednewJar
- If the new jar should be createdverbose
- 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 indexindexer
- The indexer to usemodify
- If the original jar should be modifiednewJar
- If the new jar should be createdverbose
- If we should print what we are doing to the specified info streaminfoStream
- A print stream which will record verbose info, may be nullerrStream
- 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 indexindexer
- The indexer to useoutputFile
- The index file to write tomodify
- If the original jar should be modifiednewJar
- If the new jar should be createdverbose
- If we should print what we are doing to the specified info streaminfoStream
- A print stream which will record verbose info, may be nullerrStream
- A print stream to print errors, must not be null- Returns:
- indexing result
- Throws:
IOException
- for any I/o error
-
copy
- Throws:
IOException
-
printIndexEntryInfo
-
copy
- Throws:
IOException
-
safeClose
-
safeClose
-