Examples of AbstractArchive


Examples of com.sun.enterprise.deployment.deploy.shared.AbstractArchive

            outputFile = getTempFile(path);
        }
       
        // copy all entries from source to target except the
        // runtime descriptor file
        AbstractArchive out = abstractArchiveFactory.createArchive(outputFile.getAbsolutePath());
        AbstractArchive in = abstractArchiveFactory.openArchive(path);
        Vector skipFiles = new Vector();
        skipFiles.add(getRuntimeDeploymentDescriptorPath());
        copyInto(in, out, skipFiles);
        in.close();
       
        // now save the runtime deployment descriptor...
        OutputStream os = out.putNextEntry(getRuntimeDeploymentDescriptorPath());
        writeRuntimeDeploymentDescriptors(os);
        out.closeEntry();
        out.close();
       
        // if we overwrote the old archive, need to rename the tmp now
        if (output==null) {
            AbstractArchive finalArchive = abstractArchiveFactory.openArchive(path);
            finalArchive.delete();
            AbstractArchive tmpArchive = abstractArchiveFactory.openArchive(outputFile.getAbsolutePath());
            tmpArchive.renameTo(path);
        }
       
    }
View Full Code Here

Examples of com.sun.enterprise.deployment.deploy.shared.AbstractArchive

     * @param old name
     * @param new name
     */
    protected boolean renameTmp(String from, String to) throws IOException {
       
        AbstractArchive finalArchive = abstractArchiveFactory.openArchive(to);
        finalArchive.delete();
        AbstractArchive tmpArchive = abstractArchiveFactory.openArchive(from);
        boolean success = tmpArchive.renameTo(to);
        if (!success) {           
            throw new IOException("Error renaming JAR");
        }
        return success;
    }   
View Full Code Here

Examples of com.sun.enterprise.deployment.deploy.shared.AbstractArchive

    /**
     * Copy this archivist to a new abstract archive
     * @param out the new archive to use to copy our contents into
     */
    public void copyInto(AbstractArchive target) throws IOException {
        AbstractArchive source = abstractArchiveFactory.openArchive(path);
        copyInto(source, target);
    }    
View Full Code Here

Examples of com.sun.enterprise.deployment.deploy.shared.AbstractArchive

     * extract a entry of this archive to a file
     * @param the entry name
     * @param the file to copy the entry into
     */
    public void extractEntry(String entryName, File out) throws IOException {
        AbstractArchive archive = abstractArchiveFactory.openArchive(path);
        InputStream is = archive.getEntry(entryName);
        OutputStream os = new BufferedOutputStream(new FileOutputStream(out));
        ArchivistUtils.copy(new BufferedInputStream(is), os);
        archive.close();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.