Package generic.io
Class JarWriter
java.lang.Object
generic.io.JarWriter
JarWriter is a class for writing to a jar output stream.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionJarWriter
(JarOutputStream jarOut) JarWriter
(JarOutputStream jarOut, String[] excludedExtensions) -
Method Summary
Modifier and TypeMethodDescriptionReturn the jar output stream being used by this JarWriter.static void
Simple test for the JarWriterboolean
outputEntry
(String path, long time, InputStream in, TaskMonitor monitor) Outputs an individual entry to the jar.boolean
outputFile
(File baseFile, String jarPath, TaskMonitor monitor) Outputs an individual file to the jar.boolean
outputRecursively
(File baseFile, String jarPath, TaskMonitor monitor) Recursively outputs a directory to the jar output stream If baseFile is a file then it is simply output to the jar.
-
Field Details
-
jarOut
-
-
Constructor Details
-
JarWriter
- Parameters:
jarOut
- the the jar file output stream the zip entries are to be written to.
-
JarWriter
-
-
Method Details
-
outputFile
Outputs an individual file to the jar.- Parameters:
baseFile
- the file to be outputjarPath
- the base path to prepend to the file as it is written to the jar output stream.monitor
- cancellable task monitor- Returns:
- true if file is output to the jar file successfully.
-
outputEntry
Outputs an individual entry to the jar. The data input stream will be read until and EOF is read.- Parameters:
path
- entry path within the jar filetime
- entry timein
- data input streammonitor
- cancellable task monitor- Returns:
- true if entry is output to the jar file successfully.
-
outputRecursively
Recursively outputs a directory to the jar output stream If baseFile is a file then it is simply output to the jar.- Parameters:
baseFile
- the file or directory to be outputjarPath
- the base path to prepend to the files as they are written to the jar output stream.- Returns:
- true if all files are recursively output to the jar file.
-
getJarOutputStream
Return the jar output stream being used by this JarWriter. -
main
Simple test for the JarWriter- Parameters:
args
- args[0] is the source directory, args[1] is the output filename
-