Examples of AbstractArchive


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

        throws IOException {
        Vector entriesAdded = new Vector();
        for (Iterator modules  = a.getModules();modules.hasNext();) {
            ModuleDescriptor aModule = (ModuleDescriptor) modules.next();
            entriesAdded.add(aModule.getArchiveUri());
            AbstractArchive subSource = source.getEmbeddedArchive(aModule.getArchiveUri());
            AbstractArchive subTarget = target.getEmbeddedArchive(aModule.getArchiveUri());
            Archivist newArchivist = getPluggableArchivists().getArchivistForType(aModule.getModuleType());
            newArchivist.copyInto(subSource, subTarget, overwriteManifest);
            target.closeEntry(subTarget);
            String subModulePath = subSource.getArchiveUri();
            if (subModulePath.startsWith(source.getArchiveUri())) {
View Full Code Here

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

    public static Application openArchive(Archivist archivist, File jarFile, boolean handleRuntimeInfo
        throws IOException, SAXParseException{
           
        // never read the runtime deployment descriptor before the
        // module type is found and the application object created
        AbstractArchive originalArchive  = null;
        if(jarFile.isDirectory())
        {
            originalArchive = new FileArchive();
            ((FileArchive)originalArchive).open(jarFile.getAbsolutePath());
        }
        else
        {
            originalArchive = new InputJarArchive();
            ((InputJarArchive)originalArchive).open(jarFile.getAbsolutePath());
        }
  Application application = openArchive(archivist, originalArchive, handleRuntimeInfo);
  originalArchive.close();
  return application;
    }
View Full Code Here

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

            for(Iterator modules = application.getModules(); modules.hasNext();) {
                final ModuleDescriptor moduleDescriptor =
                        ModuleDescriptor.class.cast(modules.next());
                Archivist moduleArchivist = ArchivistFactory.
                        getArchivistForType(moduleDescriptor.getModuleType());
                AbstractArchive moduleArchive = archive.getEmbeddedArchive(
                        moduleDescriptor.getArchiveUri());
                try{
                    moduleArchivist.readPersistenceDeploymentDescriptors(
                            moduleArchive, moduleDescriptor.getDescriptor());
                } finally {
                    moduleArchive.close();
                }
            }
        } else {
            // it's a standalone war/jar/rar etc.
            final ModuleDescriptor module =
View Full Code Here

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

        throws IOException, SAXParseException {   
           
        ModuleDescriptor module = super.addToArchive(appArch, externalDD);
        if (module!=null) {
            ApplicationClientDescriptor acd = (ApplicationClientDescriptor) module.getDescriptor();
            AbstractArchive jarFile = abstractArchiveFactory.openArchive(getArchiveUri());
            Manifest jarManifest = jarFile.getManifest();
            if (jarManifest!=null) {
                String mainClassName = getMainClassName(jarManifest);
                if (mainClassName!=null) {
                    acd.setMainClassName(mainClassName);
                }
            }           
            jarFile.close();           
        }
        return module;
    }
View Full Code Here

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

    public Archivist getArchivistForArchive(String path) throws IOException {
        File f = new File(path);
        if (!f.exists()) {
            throw new FileNotFoundException(path);
        }
        AbstractArchive archive;
        if (f.isDirectory()) {
            archive = new FileArchive();
            ((FileArchive) archive).open(path);
        } else {
            archive = new InputJarArchive();
            ((InputJarArchive) archive).open(path);
        }
        Archivist archivist=null;
        try {           
            archivist = getArchivistForArchive(archive);
        } finally {       
            archive.close();
        }
        return archivist;       
    }
View Full Code Here

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

        this.path = path;
  File file = new File(path);
  if (!file.exists()) {
      throw new FileNotFoundException(path);     
  }
        AbstractArchive abstractArchive = abstractArchiveFactory.openArchive(path);
        RootDeploymentDescriptor descriptor  = open(abstractArchive);
       
        abstractArchive.close();
    
        // attempt validation
        validate(null);

        return descriptor;
View Full Code Here

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

     * saves the archive
     *
     * @param outPath the file to use
     */
    public void write(String outPath) throws IOException {
        AbstractArchive in = abstractArchiveFactory.openArchive(path);       
        write(in, outPath);
        in.close();
    }   
View Full Code Here

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

     * @param input abstract archive to copy old elements from
     * @param outPath the file to use
     */
    public void write(AbstractArchive in, String outPath) throws IOException {
       
        AbstractArchive oldArchive=null;
        try {
            oldArchive = abstractArchiveFactory.openArchive(outPath);
        } catch (IOException ioe) {
            // there could be many reasons why we cannot open this archive,
            // we should continue
        }
        AbstractArchive out = null;
        BufferedOutputStream bos=null;
        try {
            String tmpName = null;
            if (oldArchive!=null && oldArchive.exists() &&
                !oldArchive.supportsElementsOverwriting()) {
                // this is a rewrite, get a temp file name...
                // I am creating a tmp file just to get a name
                File outputFile = getTempFile(outPath);   
                tmpName = outputFile.getAbsolutePath();
                outputFile.delete();
                out = abstractArchiveFactory.createArchive(tmpName);
                oldArchive.close();
            } else {
                out = abstractArchiveFactory.createArchive(outPath);
            }
       
            // write archivist content
            writeContents(in, out);
            out.close();   
            in.close();
           
            // if we were using a temp file, time to rewrite the original
            if (tmpName!=null) {
                AbstractArchive finalArchive = abstractArchiveFactory.openArchive(outPath);
                finalArchive.delete();
                AbstractArchive tmpArchive = abstractArchiveFactory.openArchive(tmpName);
                tmpArchive.renameTo(outPath);
            }      
        } catch (IOException ioe) {
            // cleanup
            if (out!=null) {
    try {
View Full Code Here

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

     * writes the content of an archive to a JarFile
     *
     * @param the jar output stream to write to
     */
    protected void writeContents(AbstractArchive out) throws IOException {
        AbstractArchive in = abstractArchiveFactory.openArchive(path);       
        writeContents(in, out);
        in.close();
    }
View Full Code Here

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

     */
    protected ModuleDescriptor addToArchive(ApplicationArchivist appArch, String externalDD)
        throws IOException, SAXParseException {
                

        AbstractArchive archiveToBeAdded = abstractArchiveFactory.openArchive(path);
        File archiveFile = new File(path);
        AbstractArchive appArchive = abstractArchiveFactory.openArchive(appArch.getArchiveUri());
  String archiveName = getUniqueEntryFilenameFor(appArchive, archiveFile.getName());
        appArchive.close();
        Descriptor descriptor = null;
  if (externalDD != null && !"".equals(externalDD)) {
            File externalDescriptorFile = new File(externalDD);           
            if (externalDescriptorFile.exists()) {
                FileInputStream fis = new FileInputStream(externalDescriptorFile);
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.