Can now read a MANIFEST from the file system. e.g. from an exploded share.war using inputstream

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@42834 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gethin James
2012-10-19 08:54:04 +00:00
parent dfd8344895
commit 06b7b23148

View File

@@ -109,9 +109,12 @@ public class WarHelperImpl implements WarHelper
* @throws ModuleManagementToolException
*/
protected String findManifestArtibute(TFile war, String attributeName) throws ModuleManagementToolException {
InputStream is = null;
try
{
InputStream is = new TFileInputStream(war+MANIFEST_FILE);
is = new TFileInputStream(war+MANIFEST_FILE);
Manifest manifest = new Manifest(is);
Attributes attribs = manifest.getMainAttributes();
return attribs.getValue(attributeName);
@@ -120,6 +123,13 @@ public class WarHelperImpl implements WarHelper
{
throw new ModuleManagementToolException("Unabled to read a manifest for the war file: "+ war);
}
finally
{
if (is != null)
{
try { is.close(); } catch (Throwable e ) {}
}
}
}