Class AbstractJarWriter
java.lang.Object
org.springframework.boot.loader.tools.AbstractJarWriter
- All Implemented Interfaces:
LoaderClassesWriter
- Direct Known Subclasses:
JarWriter
Abstract base class for JAR writers.
- Since:
- 2.3.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidwriteEntry(String entryName, InputStream inputStream) Writes an entry.voidwriteEntry(String entryName, EntryWriter entryWriter) Writes an entry.voidwriteIndexFile(String location, Collection<String> lines) Write a simple index file containing the specified UTF-8 lines.voidWrite the required spring-boot-loader classes to the JAR.voidwriteLoaderClasses(String loaderJarResourceName) Write the required spring-boot-loader classes to the JAR.voidwriteManifest(Manifest manifest) Write the specified manifest.voidwriteNestedLibrary(String location, Library library) Write a nested library.protected abstract voidwriteToArchive(ZipEntry entry, EntryWriter entryWriter)
-
Constructor Details
-
AbstractJarWriter
public AbstractJarWriter()
-
-
Method Details
-
writeManifest
Write the specified manifest.- Parameters:
manifest- the manifest to write- Throws:
IOException- of the manifest cannot be written
-
writeEntry
Writes an entry. TheinputStreamis closed once the entry has been written- Specified by:
writeEntryin interfaceLoaderClassesWriter- Parameters:
entryName- the name of the entryinputStream- the stream from which the entry's data can be read- Throws:
IOException- if the write fails
-
writeEntry
Writes an entry. TheinputStreamis closed once the entry has been written- Parameters:
entryName- the name of the entryentryWriter- the entry writer- Throws:
IOException- if the write fails
-
writeNestedLibrary
Write a nested library.- Parameters:
location- the destination of the librarylibrary- the library- Throws:
IOException- if the write fails
-
writeIndexFile
Write a simple index file containing the specified UTF-8 lines.- Parameters:
location- the location of the index filelines- the lines to write- Throws:
IOException- if the write fails- Since:
- 2.3.0
-
writeLoaderClasses
Write the required spring-boot-loader classes to the JAR.- Specified by:
writeLoaderClassesin interfaceLoaderClassesWriter- Throws:
IOException- if the classes cannot be written
-
writeLoaderClasses
Write the required spring-boot-loader classes to the JAR.- Specified by:
writeLoaderClassesin interfaceLoaderClassesWriter- Parameters:
loaderJarResourceName- the name of the resource containing the loader classes to be written- Throws:
IOException- if the classes cannot be written
-
writeToArchive
- Throws:
IOException
-