public abstract class AbstractJarWriter extends Object implements LoaderClassesWriter
Constructor and Description |
---|
AbstractJarWriter() |
Modifier and Type | Method and Description |
---|---|
void |
writeEntries(JarFile jarFile)
Deprecated.
since 2.4.8 for removal in 2.6.0 in favor of
writeEntries(JarFile, EntryTransformer, UnpackHandler, Predicate) |
void |
writeEntries(JarFile jarFile,
org.springframework.boot.loader.tools.AbstractJarWriter.EntryTransformer entryTransformer,
org.springframework.boot.loader.tools.AbstractJarWriter.UnpackHandler unpackHandler,
Predicate<JarEntry> entryFilter)
Write required entries from the specified jar file.
|
void |
writeEntry(String entryName,
EntryWriter entryWriter)
Writes an entry.
|
void |
writeEntry(String entryName,
InputStream inputStream)
Writes an entry.
|
void |
writeIndexFile(String location,
Collection<String> lines)
Write a simple index file containing the specified UTF-8 lines.
|
void |
writeLoaderClasses()
Write the required spring-boot-loader classes to the JAR.
|
void |
writeLoaderClasses(String loaderJarResourceName)
Write the required spring-boot-loader classes to the JAR.
|
void |
writeManifest(Manifest manifest)
Write the specified manifest.
|
void |
writeNestedLibrary(String location,
Library library)
Write a nested library.
|
protected abstract void |
writeToArchive(ZipEntry entry,
EntryWriter entryWriter) |
public void writeManifest(Manifest manifest) throws IOException
manifest
- the manifest to writeIOException
- of the manifest cannot be written@Deprecated public void writeEntries(JarFile jarFile) throws IOException
writeEntries(JarFile, EntryTransformer, UnpackHandler, Predicate)
jarFile
- the source jar fileIOException
- if the entries cannot be writtenpublic void writeEntries(JarFile jarFile, org.springframework.boot.loader.tools.AbstractJarWriter.EntryTransformer entryTransformer, org.springframework.boot.loader.tools.AbstractJarWriter.UnpackHandler unpackHandler, Predicate<JarEntry> entryFilter) throws IOException
jarFile
- the source jar fileentryTransformer
- the entity transformer used to change the entryunpackHandler
- the unpack handlerentryFilter
- a predicate used to filter the written entriesIOException
- if the entries cannot be writtenpublic void writeEntry(String entryName, InputStream inputStream) throws IOException
inputStream
is closed once the entry has been writtenwriteEntry
in interface LoaderClassesWriter
entryName
- the name of the entryinputStream
- the stream from which the entry's data can be readIOException
- if the write failspublic void writeEntry(String entryName, EntryWriter entryWriter) throws IOException
inputStream
is closed once the entry has been writtenentryName
- the name of the entryentryWriter
- the entry writerIOException
- if the write failspublic void writeNestedLibrary(String location, Library library) throws IOException
location
- the destination of the librarylibrary
- the libraryIOException
- if the write failspublic void writeIndexFile(String location, Collection<String> lines) throws IOException
location
- the location of the index filelines
- the lines to writeIOException
- if the write failspublic void writeLoaderClasses() throws IOException
writeLoaderClasses
in interface LoaderClassesWriter
IOException
- if the classes cannot be writtenpublic void writeLoaderClasses(String loaderJarResourceName) throws IOException
writeLoaderClasses
in interface LoaderClassesWriter
loaderJarResourceName
- the name of the resource containing the loader classes
to be writtenIOException
- if the classes cannot be writtenprotected abstract void writeToArchive(ZipEntry entry, EntryWriter entryWriter) throws IOException
IOException