/** * @return an Enumeration of entries not including entries * from the subarchives */ public Enumeration entries(java.util.Enumeration embeddedArchives) { return entries(); }
/** * Returns the existence of the given entry name * The file name must be relative to the root of the module. * * @param name the file name relative to the root of the module. * @return the existence the given entry name. */ public boolean exists(String name) throws IOException { return (getEntry(name) != null); }
protected void handleDeploymentPlan(File deploymentPlan, Archivist archivist, ReadableArchive sourceArchive, ApplicationHolder holder) throws IOException { //Note in copying of deployment plan to the portable archive, //we should make sure the manifest in the deployment plan jar //file does not overwrite the one in the original archive if (deploymentPlan != null) { DeploymentPlanArchive dpa = new DeploymentPlanArchive(); dpa.setParentArchive(sourceArchive); dpa.open(deploymentPlan.toURI()); // need to revisit for ear case WritableArchive targetArchive = archiveFactory.createArchive( sourceArchive.getURI()); if (archivist instanceof ApplicationArchivist) { ((ApplicationArchivist)archivist).copyInto(holder.app, dpa, targetArchive, false); } else { archivist.copyInto(dpa, targetArchive, false); } } }
/** * @return a sub archive giving the name */ public ReadableArchive getSubArchive(String name) throws java.io.IOException { if (jarFile==null) { return null; } DeploymentPlanArchive dpArchive = new DeploymentPlanArchive(); dpArchive.jarFile = new JarFile(new File(uri)); try { dpArchive.uri = new URI("file", uri.getSchemeSpecificPart() + File.separator + name, null); } catch (URISyntaxException e) { // } dpArchive.subArchiveUri = name; dpArchive.elements = elements; return dpArchive; }
/** * @return an input stream giving its entry name */ public InputStream getEntry(String name) throws IOException { // we are just interested in the file name, not the // relative path if (name.endsWith(".dbschema")) { name = name.replaceAll("/", "#"); } else { name = name.substring(name.lastIndexOf('/')+1); } if (subArchiveUri==null) { // we are at the "top level" return getElement(name); } else { // we are in a sub archive... // now let's mangle the name... String mangledName = subArchiveUri + "." + name; return getElement(mangledName); } }