public class JkJarWriter
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the writer.
|
static JkJarWriter |
of(java.nio.file.Path target)
Create a new
JkJarWriter instance. |
void |
writeEntries(java.util.jar.JarFile jarFile)
Write all entries from the specified jar file.
|
void |
writeEntries(java.nio.file.Path dir,
java.nio.file.PathMatcher matcher)
Write entries from the specific directories and matching the specified matcher.
|
void |
writeEntry(java.lang.String entryName,
java.io.InputStream inputStream)
Writes an entry.
|
void |
writeManifest(java.util.jar.Manifest manifest)
Write the specified manifest.
|
public static JkJarWriter of(java.nio.file.Path target)
JkJarWriter
instance.target
- the file to writejava.io.UncheckedIOException
- if the file cannot be opened or if the file cannot be foundpublic void writeManifest(java.util.jar.Manifest manifest)
manifest
- the manifest to writejava.io.UncheckedIOException
- of the manifest cannot be writtenpublic void writeEntries(java.util.jar.JarFile jarFile)
jarFile
- the source jar filejava.io.UncheckedIOException
- if the entries cannot be writtenpublic void writeEntries(java.nio.file.Path dir, java.nio.file.PathMatcher matcher)
public void writeEntry(java.lang.String entryName, java.io.InputStream inputStream)
inputStream
is closed once the entry has
been writtenentryName
- The name of the entryinputStream
- The stream from which the entry's data can be readjava.io.UncheckedIOException
- if the write failspublic void close()
java.io.UncheckedIOException
- if the file cannot be closed