Package com.sun.enterprise.deployment.deploy.shared

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


        try {
            String appName = rarName.substring(0, rarName.indexOf(ConnectorConstants.EMBEDDEDRAR_NAME_DELIMITER));
            String actualRarName = rarName.substring(rarName.indexOf(ConnectorConstants.EMBEDDEDRAR_NAME_DELIMITER) + 1);
            String appDeployLocation = ResourcesUtil.createInstance().getApplicationDeployLocation(appName);
           
            FileArchive in = new FileArchive();
            in.open(appDeployLocation);
            ApplicationArchivist archivist = new ApplicationArchivist();
            Application application = (Application) archivist.open(in);
            //get all RAR descriptors and try searching for this embedded RAR
            Set s = application.getRarDescriptors();
            for (Iterator iter = s.iterator(); iter.hasNext();) {
View Full Code Here


            earName=earName+".ear";
            try {
                JarArchiveFactory jaf = new JarArchiveFactory();
                OutputJarArchive targetJar = (OutputJarArchive)jaf.createArchive(new File(targetDir, earName).getAbsolutePath());
                FileArchiveFactory faf = new FileArchiveFactory();
                FileArchive farc = (FileArchive)faf.openArchive((new File(srcDir, earDirName)).getAbsolutePath());
                Enumeration e = farc.entries();
                String lastModuleProcessed = "";
                while(e.hasMoreElements()) {
                    String s = (String)e.nextElement();
                    String moduleDir;
                    try {
View Full Code Here

                    InputStream deploymentEntry=null;
                    try{
//                        if (f==null){
                            String uri = getAbstractArchiveUri(descriptor);
                            try {
                                FileArchive arch = new FileArchive();
                                arch.open(uri);
                                deploymentEntry = arch.getEntry(value);
                            }catch (Exception e) { }
//                        }else{
//                            try{
//                            jarFile = new JarFile(f);
//                            ZipEntry deploymentEntry1 = jarFile.getEntry(value);
View Full Code Here

  if (descriptor.getErrorPageDescriptors().hasMoreElements()) {
      boolean oneFailed = false;
      boolean foundIt = false;
//            ZipEntry ze = null;
//            JarFile jar =null;
            FileArchive arch=null;
      // get the errorpage's in this .war
      for (Enumeration e = descriptor.getErrorPageDescriptors() ; e.hasMoreElements() ;) {
    foundIt = false;
    ErrorPageDescriptorImpl errorpage = (ErrorPageDescriptorImpl) e.nextElement();
    String location = errorpage.getLocation();
            String uri = null;
                try{
//                    File f = Verifier.getArchiveFile(descriptor.getModuleDescriptor().getArchiveUri());
//                    if(f==null){
                        uri=getAbstractArchiveUri(descriptor);
                        try{
                            arch = new FileArchive();
                            arch.open(uri);
                        }catch(IOException ioe){throw ioe;}
//                    }else{
//                        jar = new JarFile(f);
//                    }
                    if (location.startsWith("/"))
                        location = location.substring(1);
//                    if (f!=null){
//                        ze = jar.getEntry(location);
//                        foundIt = (ze != null);
//                    }
//                    else{
                        File loc = new File(arch.getArchiveUri()+File.separator+location);
                        if(loc.exists())
                            foundIt=true;
                        loc = null;
//                    }
//                    if (jar!=null)
View Full Code Here

        InputStream deploymentEntry=null;
        String uri = null;

  try {
                uri = getAbstractArchiveUri(descriptor);
                 FileArchive arch = new FileArchive();
                 arch.open(uri);
                 deploymentEntry = arch.getEntry(DescriptorConstants.EJB_DD_ENTRY);

      if (deploymentEntry != null) {
    BufferedReader in = new BufferedReader(new InputStreamReader(deploymentEntry));
    String s = in.readLine();
    boolean foundDOCTYPE = false, foundPubid = false, foundURL = false;
View Full Code Here

  try {
//      File applicationJarFile = Verifier.getJarFile(descriptor.getEjbBundleDescriptor().getModuleDescriptor().getArchiveUri());
//            if (applicationJarFile == null) {
               String uri = getAbstractArchiveUri(descriptor);
               try {
                 FileArchive arch = new FileArchive();
                 arch.open(uri);
                 deploymentEntry = arch.getEntry(
                                   DescriptorConstants.EJB_DD_ENTRY);
               }catch (IOException e) { throw e;}
//            }
//            else {
//        jarFile = new JarFile(applicationJarFile);
View Full Code Here

  if (descriptor.getLoginConfiguration() != null) {
      boolean foundIt = false;
//            ZipEntry ze = null;
//            JarFile jar =null;
            FileArchive arch=null;
     
            String formLoginPage = descriptor.getLoginConfiguration().getFormLoginPage();
            if (formLoginPage.length() > 0) {
        
                try{
//                    File f = Verifier.getArchiveFile(descriptor.getModuleDescriptor().getArchiveUri());
//                    if(f==null){
                        String uri=getAbstractArchiveUri(descriptor);
                        try{
                            arch = new FileArchive();
                            arch.open(uri);
                        }catch(IOException e){throw e;}
//                    }else{
//                        jar = new JarFile(f);
//                    }
                    if (formLoginPage.startsWith("/"))
                        formLoginPage=formLoginPage.substring(1);
//                        if (f!=null){
//                        ze = jar.getEntry(formLoginPage);
//                        foundIt = (ze != null);
//                    }
//                    else{
                        File flp = new File(arch.getArchiveUri()+File.separator+formLoginPage);
                        if(flp.exists())
                            foundIt=true;
                        flp = null;
//                    }
//                    if (jar!=null)
View Full Code Here

                       
      try {
//                            if (f==null){
                                String uri = getAbstractArchiveUri(descriptor);
//                                try {
                                    FileArchive arch = new FileArchive();
                                    arch.open(uri);
                                    deploymentEntry = arch.getEntry(acd.getModuleDescriptor().getAlternateDescriptor());
//                                }catch (Exception e) { }
//                            }else{
//
//                                jarFile = new JarFile(f);
//                                ZipEntry deploymentEntry1 = jarFile.getEntry(acd.getModuleDescriptor().getAlternateDescriptor());
View Full Code Here

     * @param fileID The archive file name
     * @param result where to place the result
     */
    public static void testFileExistence(String uri, String fileName, String fileID, Result result) {
       
       FileArchive arch=null;
//       ZipEntry ze=null;
       JarFile jarFile=null;
      
       if (fileName == null || fileName.length()==0) {
      result.notApplicable(smh.getLocalString
              ("com.sun.enterprise.tools.verifier.tests.VerifierTest.fileexistence.notApplicable",
                 "No {0} defined in deployment descriptors",
                 new Object[] {fileID}));                       
            return;
        }
//        if (file==null){
            try{
                arch = new FileArchive();
                arch.open(uri);
            }catch(Exception e){}  
//        }else{
//            try {
//                jarFile = new JarFile(file);
//            } catch (java.io.IOException ioe) {
//                Verifier.debug(ioe);
//                result.failed(smh.getLocalString
//                        ("com.sun.enterprise.tools.verifier.tests.VerifierTest.fileexistence.failed",
//                         "Error:  {0} [ {1} ] not found in the archive",
//                         new Object[] {fileID, fileName}));     
//                         return;
//             }
//         }
        try{
//            if (file!=null){
//            ze = jarFile.getEntry(fileName);
//            if (ze == null) {
//                result.failed(smh.getLocalString
//                    ("com.sun.enterprise.tools.verifier.tests.VerifierTest.fileexistence.failed",
//                    "Error: {0} [ {1} ] not found in the archive",
//                    new Object[] {fileID, fileName}));                          
//            }else{
//                result.passed(smh.getLocalString
//                ("com.sun.enterprise.tools.verifier.tests.VerifierTest.fileexistence.passed",
//                "{0} [ {1} ] found in the archive",
//                new Object[] {fileID, fileName}));                          
//            }
//        }
//        else{
            File urif = new File(arch.getArchiveUri()+File.separator+fileName);
            if(urif.exists()){
                result.passed(smh.getLocalString
                ("com.sun.enterprise.tools.verifier.tests.VerifierTest.fileexistence.passed",
                "{0} [ {1} ] found in the archive",
                new Object[] {fileID, fileName}));                          
View Full Code Here

                       
      try {
//                            if (f==null){
                                String uri = getAbstractArchiveUri(descriptor);
//                                try {
                                    FileArchive arch = new FileArchive();
                                    arch.open(uri);
                                    deploymentEntry = arch.getEntry(wbd.getModuleDescriptor().getAlternateDescriptor());
//                                }catch (Exception e) { }
//                            }else{
//
//                                jarFile = new JarFile(f);
//                                ZipEntry deploymentEntry1 = jarFile.getEntry(wbd.getModuleDescriptor().getAlternateDescriptor());
View Full Code Here

TOP

Related Classes of com.sun.enterprise.deployment.deploy.shared.FileArchive

Copyright © 2018 www.massapicom. 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.