|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rhq.core.util.file.ContentFileInfo
org.rhq.core.util.file.JarContentFileInfo
public class JarContentFileInfo
Return the version of the jar file by inspecting the Manifest. The file does not necessarily need to be a jar but rather can be any archive satisfying jar file structure (e.g. an .ear or .war), exploded or not.
| Constructor Summary | |
|---|---|
JarContentFileInfo(File file)
|
|
| Method Summary | |
|---|---|
String |
getAttributeValue(Attributes.Name attributeName,
String defaultValue)
Returns an attribute value as found in the manifest. |
String |
getAttributeValue(String attributeName,
String defaultValue)
Returns an attribute value as found in the manifest. |
String |
getDescription(String defaultValue)
Return a description of the Jar file (or archive satisfying Jar file structure) by inspecting the Manifest. |
String |
getVersion(String defaultValue)
Returns the version of the Jar file (or archive satisfying Jar file structure) by inspecting the Manifest. |
boolean |
isValid()
Determines if the content file is a valid jar file (i.e. |
| Methods inherited from class org.rhq.core.util.file.ContentFileInfo |
|---|
getContentFile |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JarContentFileInfo(File file)
| Method Detail |
|---|
public boolean isValid()
true, you still are not guaranteed the jar
file has a non-null version because there may not
be a version attribute in the manifest.
isValid in class ContentFileInfotrue if the file is a valid jar file with a manifestpublic String getVersion(String defaultValue)
getVersion in class ContentFileInfodefaultValue - the default value
public String getDescription(String defaultValue)
getDescription in class ContentFileInfodefaultValue - the default value
null if it cannot be determined
public String getAttributeValue(Attributes.Name attributeName,
String defaultValue)
attributeName - the attribute namedefaultValue - the default if the attribute does not exist in the manifest
public String getAttributeValue(String attributeName,
String defaultValue)
attributeName - the attribute namedefaultValue - the default if the attribute does not exist in the manifest
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||