@Override protected T parse(VFSDeploymentUnit unit, VirtualFile file, T root) throws Exception { Manifest manifest = VFSUtils.readManifest(file); return createMetaData(manifest); } }
private String getMainClassName(VFSDeploymentUnit unit) throws IOException { VirtualFile file = unit.getMetaDataFile("MANIFEST.MF"); log.trace("parsing " + file); if(file == null) { return null; } Manifest mf = VFSUtils.readManifest(file); Attributes attrs = mf.getMainAttributes(); String className = attrs.getValue(Attributes.Name.MAIN_CLASS); return className; }
protected String getMainClassName(VFSDeploymentUnit unit, boolean fail) throws Exception { VirtualFile file = unit.getMetaDataFile("MANIFEST.MF"); log.trace("parsing " + file); // Default to the jboss client main String mainClassName = "org.jboss.client.AppClientMain"; if (file != null) { Manifest mf = VFSUtils.readManifest(file); Attributes attrs = mf.getMainAttributes(); String className = attrs.getValue(Attributes.Name.MAIN_CLASS); if (className != null) { mainClassName = className; } } return mainClassName; }
/** * Get main class from manifest. * * @param unit the deployment unit * @return main class name * @throws IOException for any error */ protected String getMainClassName(VFSDeploymentUnit unit) throws IOException { VirtualFile file = unit.getMetaDataFile("MANIFEST.MF"); if (log.isTraceEnabled()) log.trace("parsing " + file); if(file == null) { return null; } Manifest mf = VFSUtils.readManifest(file); Attributes attrs = mf.getMainAttributes(); return attrs.getValue(Attributes.Name.MAIN_CLASS); } }
/** * Construct a {@link VirtualJarInputStream} from a {@link VirtualFile} root * * @param root VirtualFile directory to use as the base of the virtual Jar. * @throws IOException */ public VirtualJarInputStream(VirtualFile root) throws IOException { super(VFSUtils.emptyStream()); this.root = root; final VirtualFile manifest = root.getChild(JarFile.MANIFEST_NAME); if (manifest.exists()) { entryItr.add(Collections.singleton(manifest).iterator()); this.manifest = VFSUtils.readManifest(manifest); } else { this.manifest = null; } entryItr.add(root.getChildren().iterator()); }
Manifest mf = VFSUtils.readManifest(mfFile); Attributes attrs = mf.getMainAttributes(); if( attrs.containsKey(Attributes.Name.MAIN_CLASS) )
Manifest mf = VFSUtils.readManifest(mfFile); Attributes attrs = mf.getMainAttributes(); if( attrs.containsKey(Attributes.Name.MAIN_CLASS) )
/** * Get a manifest from a virtual file, assuming the virtual file is the root of an archive * * @param archive the root the archive * @return the manifest or null if not found * @throws IOException if there is an error reading the manifest or the virtual file is closed * @throws IllegalArgumentException for a null archive */ public static Manifest getManifest(VirtualFile archive) throws IOException { if (archive == null) { throw MESSAGES.nullArgument("archive"); } VirtualFile manifest = archive.getChild(JarFile.MANIFEST_NAME); if (manifest == null || !manifest.exists()) { if (VFSLogger.ROOT_LOGGER.isTraceEnabled()) { VFSLogger.ROOT_LOGGER.tracef("Can't find manifest for %s", archive.getPathName()); } return null; } return readManifest(manifest); }