org.springframework.boot.loader.tools

Class JarWriter

    • Method Detail

      • writeManifest

        public void writeManifest(Manifest manifest)
                           throws IOException
        Write the specified manifest.
        Parameters:
        manifest - the manifest to write
        Throws:
        IOException - of the manifest cannot be written
      • writeEntries

        public void writeEntries(JarFile jarFile)
                          throws IOException
        Write all entries from the specified jar file.
        Parameters:
        jarFile - the source jar file
        Throws:
        IOException - if the entries cannot be written
      • writeEntry

        public void writeEntry(String entryName,
                               InputStream inputStream)
                        throws IOException
        Writes an entry. The inputStream is closed once the entry has been written
        Specified by:
        writeEntry in interface LoaderClassesWriter
        Parameters:
        entryName - the name of the entry
        inputStream - the stream from which the entry's data can be read
        Throws:
        IOException - if the write fails
      • writeNestedLibrary

        public void writeNestedLibrary(String destination,
                                       Library library)
                                throws IOException
        Write a nested library.
        Parameters:
        destination - the destination of the library
        library - the library
        Throws:
        IOException - if the write fails
      • writeLoaderClasses

        public void writeLoaderClasses(String loaderJarResourceName)
                                throws IOException
        Write the required spring-boot-loader classes to the JAR.
        Specified by:
        writeLoaderClasses in interface LoaderClassesWriter
        Parameters:
        loaderJarResourceName - the name of the resource containing the loader classes to be written
        Throws:
        IOException - if the classes cannot be written