public abstract class JarUtils extends Object
JarCreator, this class is
stateless and contains only static methods (hence the abstract qualifier).| Constructor and Description |
|---|
JarUtils() |
| Modifier and Type | Method and Description |
|---|---|
static int |
createJar(Manifest manifest,
Map entries,
OutputStream outputStream)
Creates a jar based on the given entries and manifest.
|
static String |
dumpJarContent(JarInputStream jis)
Dumps the entries of a jar and return them as a String.
|
static String |
dumpJarContent(org.springframework.core.io.Resource resource)
Dump the entries of a jar and return them as a String.
|
static Manifest |
getManifest(InputStream stream)
Read the manifest for a given stream.
|
static Manifest |
getManifest(org.springframework.core.io.Resource resource)
Convenience method for reading a manifest from a given resource.
|
static int |
writeToJar(org.springframework.core.io.Resource res,
String entryName,
JarOutputStream jarStream)
Writes a resource content to a jar.
|
static int |
writeToJar(org.springframework.core.io.Resource res,
String entryName,
JarOutputStream jarStream,
int bufferSize)
Writes a resource content to a jar.
|
public static String dumpJarContent(JarInputStream jis)
jis - Exceptionpublic static String dumpJarContent(org.springframework.core.io.Resource resource)
resource - public static int writeToJar(org.springframework.core.io.Resource res,
String entryName,
JarOutputStream jarStream)
throws IOException
res - entryName - jarStream - ExceptionIOExceptionpublic static int writeToJar(org.springframework.core.io.Resource res,
String entryName,
JarOutputStream jarStream,
int bufferSize)
throws IOException
res - entryName - jarStream - bufferSize - ExceptionIOExceptionpublic static Manifest getManifest(InputStream stream)
stream - public static Manifest getManifest(org.springframework.core.io.Resource resource)
resource - public static int createJar(Manifest manifest, Map entries, OutputStream outputStream) throws IOException
manifest - jar manifestentries - map of resources keyed by the jar entry namedoutputStream - output stream for writing the jarIOExceptionCopyright © 2006–2023. All rights reserved.