Class Repackager
java.lang.Object
org.springframework.boot.loader.tools.Packager
org.springframework.boot.loader.tools.Repackager
Utility class that can be used to repackage an archive so that it can be executed using
 'java -jar'.
- Since:
- 1.0.0
- 
Nested Class SummaryNested classes/interfaces inherited from class org.springframework.boot.loader.tools.PackagerPackager.MainClassTimeoutWarningListener
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidRepackage to the given destination so that it can be launched using ' java -jar'.voidrepackage(File destination, Libraries libraries, LaunchScript launchScript) Repackage to the given destination so that it can be launched using ' java -jar'.voidrepackage(File destination, Libraries libraries, LaunchScript launchScript, FileTime lastModifiedTime) Repackage to the given destination so that it can be launched using ' java -jar'.voidRepackage the source file so that it can be run using 'java -jar'.voidsetBackupSource(boolean backupSource) Sets if source files should be backed up when they would be overwritten.protected voidwriteSignatureFileIfNecessary(Map<String, Library> writtenLibraries, AbstractJarWriter writer) Methods inherited from class org.springframework.boot.loader.tools.PackageraddMainClassTimeoutWarningListener, findMainMethod, getBackupFile, getLayout, getSource, isAlreadyPackaged, isAlreadyPackaged, setBackupFile, setIncludeRelevantJarModeJars, setLayers, setLayout, setLayoutFactory, setLoaderImplementation, setMainClass, write, write
- 
Constructor Details- 
RepackagerCreate a newRepackagerinstance.- Parameters:
- source- the source archive file to package
 
 
- 
- 
Method Details- 
writeSignatureFileIfNecessaryprotected void writeSignatureFileIfNecessary(Map<String, Library> writtenLibraries, AbstractJarWriter writer) throws IOException- Overrides:
- writeSignatureFileIfNecessaryin class- Packager
- Throws:
- IOException
 
- 
setBackupSourcepublic void setBackupSource(boolean backupSource) Sets if source files should be backed up when they would be overwritten.- Parameters:
- backupSource- if source files should be backed up
 
- 
repackageRepackage the source file so that it can be run using 'java -jar'.- Parameters:
- libraries- the libraries required to run the archive
- Throws:
- IOException- if the file cannot be repackaged
 
- 
repackageRepackage to the given destination so that it can be launched using ' java -jar'.- Parameters:
- destination- the destination file (may be the same as the source)
- libraries- the libraries required to run the archive
- Throws:
- IOException- if the file cannot be repackaged
 
- 
repackagepublic void repackage(File destination, Libraries libraries, LaunchScript launchScript) throws IOException Repackage to the given destination so that it can be launched using ' java -jar'.- Parameters:
- destination- the destination file (may be the same as the source)
- libraries- the libraries required to run the archive
- launchScript- an optional launch script prepended to the front of the jar
- Throws:
- IOException- if the file cannot be repackaged
- Since:
- 1.3.0
 
- 
repackagepublic void repackage(File destination, Libraries libraries, LaunchScript launchScript, FileTime lastModifiedTime) throws IOException Repackage to the given destination so that it can be launched using ' java -jar'.- Parameters:
- destination- the destination file (may be the same as the source)
- libraries- the libraries required to run the archive
- launchScript- an optional launch script prepended to the front of the jar
- lastModifiedTime- an optional last modified time to apply to the archive and its contents
- Throws:
- IOException- if the file cannot be repackaged
- Since:
- 2.3.0
 
 
-