mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Can now read a MANIFEST from the file system. e.g. from an exploded share.war
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@42833 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -27,6 +27,7 @@ public class WarHelperImpl implements WarHelper
|
||||
{
|
||||
|
||||
public static final String VERSION_PROPERTIES = "/WEB-INF/classes/alfresco/version.properties";
|
||||
public static final String MANIFEST_FILE = "/META-INF/MANIFEST.MF";
|
||||
|
||||
//see http://docs.oracle.com/javase/6/docs/technotes/guides/jar/jar.html#Main%20Attributes
|
||||
public static final String MANIFEST_SPECIFICATION_TITLE = "Specification-Title";
|
||||
@@ -110,8 +111,8 @@ public class WarHelperImpl implements WarHelper
|
||||
protected String findManifestArtibute(TFile war, String attributeName) throws ModuleManagementToolException {
|
||||
try
|
||||
{
|
||||
JarFile warAsJar = new JarFile(war);
|
||||
Manifest manifest = warAsJar.getManifest();
|
||||
InputStream is = new TFileInputStream(war+MANIFEST_FILE);
|
||||
Manifest manifest = new Manifest(is);
|
||||
Attributes attribs = manifest.getMainAttributes();
|
||||
return attribs.getValue(attributeName);
|
||||
}
|
||||
|
Reference in New Issue
Block a user