public final class JkManifest<T>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
T |
__
For parent chaining
|
static java.lang.String |
BUILD_JDK
The JDK version who was running while building this manifest.
|
static java.lang.String |
CREATED_BY
The software that has created this manifest.
|
static java.lang.String |
IMPLEMENTATION_TITLE
The title of the implementation.
|
static java.lang.String |
IMPLEMENTATION_VENDOR
The version of the implementation.
|
static java.lang.String |
IMPLEMENTATION_VERSION
The version of the implementation.
|
static java.lang.String |
STANDARD_LOCATION
The path where generally belongs all manifest past (relative to archive root)
|
Modifier and Type | Method and Description |
---|---|
JkManifest<T> |
addAutodetectMain(java.nio.file.Path classDir)
Adds the main class entry by auto-detecting the class holding the main method.
|
JkManifest<T> |
addContextualInfo()
|
JkManifest<T> |
addMainAttribute(java.util.jar.Attributes.Name key,
java.lang.String value)
Adds the specified attributes in the "main" attributes section.
|
JkManifest<T> |
addMainAttribute(java.lang.String key,
java.lang.String value) |
JkManifest<T> |
addMainClass(java.lang.String value)
Adds the 'Main-Class' attribute to this manifest.
|
java.lang.String |
getMainAttribute(java.util.jar.Attributes.Name name)
Returns the value of the main attribute having the specified name.
|
java.lang.String |
getMainAttribute(java.lang.String key)
Returns the value of the main attribute having the specified name.
|
java.util.jar.Manifest |
getManifest()
Returns the underlying JDK
Manifest object. |
boolean |
isEmpty()
Returns
true if this manifest has no entry or has only
"Manifest-Version" entry. |
JkManifest<T> |
merge(java.util.jar.Manifest other)
Adds attributes of the specified manifest to this one.
|
static JkManifest<java.lang.Void> |
of()
Creates an empty JkManifest
|
static <T> JkManifest<T> |
ofParent(T parent)
Same as
of() but providing a parent for method chaining |
JkManifest<T> |
setManifest(java.util.jar.Manifest manifest)
Sets the underlying
Manifest object. |
JkManifest<T> |
setManifestFromClass(java.lang.Class<?> clazz)
Set the values from the specified i,n the manifest belonging to the specified class jar.
|
JkManifest<T> |
setManifestFromClassRootDir(java.nio.file.Path classDir)
Sets the underlying
Manifest object from the file present at [specified class dir]/META-INF/MANIFEST.MF |
JkManifest<T> |
setManifestFromFile(java.nio.file.Path file)
Sets the underlying
Manifest object from the content of the specified file. |
JkManifest<T> |
setManifestFromInputStream(java.io.InputStream inputStream)
Set the values from the specified inputStream source.
|
void |
writeTo(java.nio.file.Path file) |
void |
writeToStandardLocation(java.nio.file.Path classDir)
Writes this manifest at the standard place (META-INF/MANIFEST.MF) of the
specified directory.
|
public static final java.lang.String STANDARD_LOCATION
public static final java.lang.String BUILD_JDK
public static final java.lang.String CREATED_BY
public static final java.lang.String IMPLEMENTATION_TITLE
public static final java.lang.String IMPLEMENTATION_VERSION
public static final java.lang.String IMPLEMENTATION_VENDOR
public final T __
public static JkManifest<java.lang.Void> of()
public static <T> JkManifest<T> ofParent(T parent)
of()
but providing a parent for method chainingpublic java.util.jar.Manifest getManifest()
Manifest
object.public JkManifest<T> setManifest(java.util.jar.Manifest manifest)
Manifest
object. Tpublic JkManifest<T> setManifestFromFile(java.nio.file.Path file)
Manifest
object from the content of the specified file.public JkManifest<T> setManifestFromClassRootDir(java.nio.file.Path classDir)
Manifest
object from the file present at [specified class dir]/META-INF/MANIFEST.MFpublic JkManifest<T> setManifestFromInputStream(java.io.InputStream inputStream)
public JkManifest<T> setManifestFromClass(java.lang.Class<?> clazz)
public JkManifest<T> addMainAttribute(java.util.jar.Attributes.Name key, java.lang.String value)
public JkManifest<T> addAutodetectMain(java.nio.file.Path classDir)
public JkManifest<T> addMainAttribute(java.lang.String key, java.lang.String value)
#addMainAttribute(Name, String)
public JkManifest<T> addMainClass(java.lang.String value)
public JkManifest<T> addContextualInfo()
public java.lang.String getMainAttribute(java.lang.String key)
public java.lang.String getMainAttribute(java.util.jar.Attributes.Name name)
public JkManifest<T> merge(java.util.jar.Manifest other)
public void writeToStandardLocation(java.nio.file.Path classDir)
public void writeTo(java.nio.file.Path file)
public boolean isEmpty()
true
if this manifest has no entry or has only
"Manifest-Version" entry.