|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.maven.jar.JarUtils
public class JarUtils
Utility class for maven-jar-plugin. Currently only used for testing the manifest created by Maven's jar:jar goal.
Constructor Summary | |
---|---|
JarUtils()
|
Method Summary | |
---|---|
boolean |
containsMainAttribute(String key)
Checks if the current manifest contains a main attribute with the given key. |
boolean |
containsSection(String key)
Checks if the current manifest contains a section with the given key. |
boolean |
containsSectionAttribute(String key)
Checks if the current manifest contains a section attribute with the given key. |
void |
extractManifestFromFile(File manifestFile)
Extracts the manifest from a given file. |
void |
extractManifestFromJar(File theJarFile)
Extracts the manifest from the given jar file. |
String |
getMainAttribute(String key)
Returns the value of the main attribute key. |
Attributes |
getMainAttributes()
Returns the main attributes of the manifest as Attributes. |
Manifest |
getManifest()
Gets the manifest. |
Map |
getManifestEntries()
Returns a Map of manifest entries. |
String |
getSectionAttribute(String key)
Returns the value of the section attribute key. |
void |
setManifest(Manifest mf)
Sets the manifest. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JarUtils()
Method Detail |
---|
public void extractManifestFromJar(File theJarFile) throws IOException
theJarFile
- The jar file to extract the manifest from.
IOException
- If there is an error opening the jar file.public void extractManifestFromFile(File manifestFile) throws IOException
manifestFile
- The manifest file.
IOException
- If there is an error opening the file.public void setManifest(Manifest mf)
mf
- The new manifest.public Manifest getManifest()
public Map getManifestEntries()
public Attributes getMainAttributes()
public boolean containsSection(String key)
key
- The section name.
public String getMainAttribute(String key)
key
- The attribute name.
public boolean containsMainAttribute(String key)
key
- The main attribute name.
public String getSectionAttribute(String key)
key
- The attribute name.
public boolean containsSectionAttribute(String key)
key
- The section attribute name.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |