plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/operations/GeronimoServerV21PluginManager.java [713:775]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    private void writeToRepository(File inputDir, File outputDir) throws Exception {
        Trace.tracePoint("Entry", Activator.traceOperations, "GeronimoServerPluginManager.writeToRepository", inputDir,outputDir);

        outputDir.mkdirs();
        File[] all = inputDir.listFiles();
        for (File file : all) {
            if (file.isDirectory()) {
                String oDir = outputDir.getAbsolutePath() + File.separator + file.getName();
                File temp = new File (oDir);
                writeToRepository(file, temp);
            }else if(file.getName().toLowerCase().endsWith(".car"))
            {
               String oDir = outputDir.getAbsolutePath() + File.separator + file.getName();
                File temp = new File (oDir);
                
                ZipInputStream in=new ZipInputStream(new FileInputStream(file));            
                try {
                    byte[] buffer = new byte[10240];
                    for (ZipEntry entry = in.getNextEntry(); entry != null; entry = in.getNextEntry()) {
                        File zipFile = new File(temp, entry.getName());
                        if (entry.isDirectory()) {
                           zipFile.mkdirs();
                        } else {
                            if (!entry.getName().equals("META-INF/startup-jar")) {
                               zipFile.getParentFile().mkdirs();
                                OutputStream out = new FileOutputStream(zipFile);
                                try {
                                    int count;
                                    while ((count = in.read(buffer)) > 0) {
                                        out.write(buffer, 0, count);                                    
                                    }
                                } finally {                                 
                                    out.close();
                                }
                                in.closeEntry();
                            }
                        }
                    }
                } catch (IOException e) {               
                    throw e;
                } finally {
                    in.close();          
                }
            }
            else {
                File entry = new File(outputDir + File.separator + file.getName());
                FileOutputStream out = new FileOutputStream (entry);
                FileInputStream in = new FileInputStream(file);
                byte[] buf = new byte[10240];
                int count;
                try {
                    while ((count = in.read(buf, 0, buf.length)) > -1) {
                        out.write(buf, 0, count);
                    }
                } finally {
                    in.close();
                    out.flush();
                    out.close();
                }
            }
        }
        Trace.tracePoint("Exit", Activator.traceOperations, "GeronimoServerPluginManager.writeToRepository");
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/operations/GeronimoServerPluginManager.java [700:762]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    private void writeToRepository(File inputDir, File outputDir) throws Exception {
        Trace.tracePoint("Entry", Activator.traceOperations, "GeronimoServerPluginManager.writeToRepository", inputDir,outputDir);

        outputDir.mkdirs();
        File[] all = inputDir.listFiles();
        for (File file : all) {
            if (file.isDirectory()) {
                String oDir = outputDir.getAbsolutePath() + File.separator + file.getName();
                File temp = new File (oDir);
                writeToRepository(file, temp);
            }else if(file.getName().toLowerCase().endsWith(".car"))
            {
               String oDir = outputDir.getAbsolutePath() + File.separator + file.getName();
                File temp = new File (oDir);
                
                ZipInputStream in=new ZipInputStream(new FileInputStream(file));            
                try {
                    byte[] buffer = new byte[10240];
                    for (ZipEntry entry = in.getNextEntry(); entry != null; entry = in.getNextEntry()) {
                        File zipFile = new File(temp, entry.getName());
                        if (entry.isDirectory()) {
                           zipFile.mkdirs();
                        } else {
                            if (!entry.getName().equals("META-INF/startup-jar")) {
                               zipFile.getParentFile().mkdirs();
                                OutputStream out = new FileOutputStream(zipFile);
                                try {
                                    int count;
                                    while ((count = in.read(buffer)) > 0) {
                                        out.write(buffer, 0, count);                                    
                                    }
                                } finally {                                 
                                    out.close();
                                }
                                in.closeEntry();
                            }
                        }
                    }
                } catch (IOException e) {               
                    throw e;
                } finally {
                    in.close();          
                }
            }
            else {
                File entry = new File(outputDir + File.separator + file.getName());
                FileOutputStream out = new FileOutputStream (entry);
                FileInputStream in = new FileInputStream(file);
                byte[] buf = new byte[10240];
                int count;
                try {
                    while ((count = in.read(buf, 0, buf.length)) > -1) {
                        out.write(buf, 0, count);
                    }
                } finally {
                    in.close();
                    out.flush();
                    out.close();
                }
            }
        }
        Trace.tracePoint("Exit", Activator.traceOperations, "GeronimoServerPluginManager.writeToRepository");
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



plugins/org.apache.geronimo.st.v22.core/src/main/java/org/apache/geronimo/st/v22/core/operations/GeronimoServerV22PluginManager.java [716:778]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    private void writeToRepository(File inputDir, File outputDir) throws Exception {
        Trace.tracePoint("Entry", Activator.traceOperations, "GeronimoServerPluginManager.writeToRepository", inputDir,outputDir);

        outputDir.mkdirs();
        File[] all = inputDir.listFiles();
        for (File file : all) {
            if (file.isDirectory()) {
                String oDir = outputDir.getAbsolutePath() + File.separator + file.getName();
                File temp = new File (oDir);
                writeToRepository(file, temp);
            }else if(file.getName().toLowerCase().endsWith(".car"))
            {
               String oDir = outputDir.getAbsolutePath() + File.separator + file.getName();
                File temp = new File (oDir);
                
                ZipInputStream in=new ZipInputStream(new FileInputStream(file));            
                try {
                    byte[] buffer = new byte[10240];
                    for (ZipEntry entry = in.getNextEntry(); entry != null; entry = in.getNextEntry()) {
                        File zipFile = new File(temp, entry.getName());
                        if (entry.isDirectory()) {
                           zipFile.mkdirs();
                        } else {
                            if (!entry.getName().equals("META-INF/startup-jar")) {
                               zipFile.getParentFile().mkdirs();
                                OutputStream out = new FileOutputStream(zipFile);
                                try {
                                    int count;
                                    while ((count = in.read(buffer)) > 0) {
                                        out.write(buffer, 0, count);                                    
                                    }
                                } finally {                                 
                                    out.close();
                                }
                                in.closeEntry();
                            }
                        }
                    }
                } catch (IOException e) {               
                    throw e;
                } finally {
                    in.close();          
                }
            }
            else {
                File entry = new File(outputDir + File.separator + file.getName());
                FileOutputStream out = new FileOutputStream (entry);
                FileInputStream in = new FileInputStream(file);
                byte[] buf = new byte[10240];
                int count;
                try {
                    while ((count = in.read(buf, 0, buf.length)) > -1) {
                        out.write(buf, 0, count);
                    }
                } finally {
                    in.close();
                    out.flush();
                    out.close();
                }
            }
        }
        Trace.tracePoint("Exit", Activator.traceOperations, "GeronimoServerPluginManager.writeToRepository");
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



