public class CompressSpringbootJarWriter extends java.lang.Object implements java.lang.AutoCloseable, SpringbootJarWriter
COMMONS_COMPRESS, COMMONS_IO, IMPL_CLASS| Constructor and Description |
|---|
CompressSpringbootJarWriter(java.nio.file.Path targetPath)
Create a new
CompressSpringbootJarWriter instance. |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the writer.
|
void |
setExecutableFilePermission(java.nio.file.Path path) |
void |
writeEntries(java.util.jar.JarFile jarFile)
Write all entries from the specified jar file.
|
void |
writeEntry(java.lang.String entryName,
java.io.InputStream inputStream)
Writes an entry.
|
void |
writeLoaderClasses(java.net.URL loaderJar) |
void |
writeManifest(java.util.jar.Manifest manifest)
Write the specified manifest.
|
void |
writeNestedLibrary(java.lang.String destination,
java.nio.file.Path library)
Write a nested library.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitof, thisJarPathpublic CompressSpringbootJarWriter(java.nio.file.Path targetPath)
CompressSpringbootJarWriter instance.file - the file to writejava.io.IOException - if the file cannot be openedjava.io.FileNotFoundException - if the file cannot be foundpublic void setExecutableFilePermission(java.nio.file.Path path)
setExecutableFilePermission in interface SpringbootJarWriterpublic void writeManifest(java.util.jar.Manifest manifest)
writeManifest in interface SpringbootJarWritermanifest - the manifest to writejava.io.IOException - of the manifest cannot be writtenpublic void writeEntries(java.util.jar.JarFile jarFile)
jarFile - the source jar filejava.io.IOException - if the entries cannot be writtenpublic void writeLoaderClasses(java.net.URL loaderJar)
writeLoaderClasses in interface SpringbootJarWriterpublic void writeEntry(java.lang.String entryName,
java.io.InputStream inputStream)
inputStream is closed once the entry has been writtenwriteEntry in interface SpringbootJarWriterentryName - the name of the entryinputStream - the stream from which the entry's data can be readjava.io.IOException - if the write failspublic void writeNestedLibrary(java.lang.String destination,
java.nio.file.Path library)
writeNestedLibrary in interface SpringbootJarWriterdestination - the destination of the librarylibrary - the libraryjava.io.IOException - if the write failspublic void close()
throws java.io.IOException
close in interface SpringbootJarWriterclose in interface java.lang.AutoCloseablejava.io.IOException - if the file cannot be closed