geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r1360407 - /geronimo/server/branches/3.0/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/util/FileUtils.java
Date Wed, 11 Jul 2012 21:19:04 GMT
Author: gawor
Date: Wed Jul 11 21:19:04 2012
New Revision: 1360407

URL: http://svn.apache.org/viewvc?rev=1360407&view=rev
Log:
functions are no longer needed

Modified:
    geronimo/server/branches/3.0/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/util/FileUtils.java

Modified: geronimo/server/branches/3.0/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/util/FileUtils.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/util/FileUtils.java?rev=1360407&r1=1360406&r2=1360407&view=diff
==============================================================================
--- geronimo/server/branches/3.0/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/util/FileUtils.java
(original)
+++ geronimo/server/branches/3.0/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/util/FileUtils.java
Wed Jul 11 21:19:04 2012
@@ -43,7 +43,6 @@ import java.util.Set;
 import java.util.jar.JarEntry;
 import java.util.jar.JarFile;
 import java.util.zip.ZipEntry;
-import java.util.zip.ZipInputStream;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -219,41 +218,6 @@ public class FileUtils {
             }
         }
     }
-    
-    //Overwrite files in dest directory
-    public static void recursiveCopyOverwrite(File srcDir, File destDir) throws IOException
{
-        if (srcDir == null)
-            throw new NullPointerException("sourceDir is null");
-        if (destDir == null)
-            throw new NullPointerException("destDir is null");
-        if (!srcDir.isDirectory() || !srcDir.canRead()) {
-            throw new IllegalArgumentException("Source directory must be a readable directory
" + srcDir);
-        }
-        
-        if (srcDir.equals(destDir)) {
-            throw new IllegalArgumentException("Source and destination directory are the
same " + srcDir);
-        }
-        
-        if (!destDir.exists()) {
-            destDir.mkdirs();
-        }
-        
-        if (!destDir.exists()) {
-            throw new IOException("Could not create destination directory " + destDir);
-        }
-        File[] srcFiles = srcDir.listFiles();
-        if (srcFiles != null) {
-            for (int i = 0; i < srcFiles.length; i++) {
-                File srcFile = srcFiles[i];
-                File destFile = new File(destDir, srcFile.getName());
-                if (srcFile.isDirectory()) {
-                    recursiveCopyOverwrite(srcFile, destFile);
-                } else {
-                    copyFile(srcFile, destFile);
-                }
-            }
-        }
-    }
 
     public static boolean recursiveDelete(File root) {
         return recursiveDelete(root, null);
@@ -475,49 +439,6 @@ public class FileUtils {
             logger.debug(file.getPath());
         }
     }
-    
-    public static void unpackFile(InputStream source, File target) throws IOException{
-        
-        ZipInputStream in = new ZipInputStream(source);
-        try {
-
-            int threshold = 10240;
-            byte[] buffer = new byte[10240];
-
-            for (ZipEntry entry = in.getNextEntry(); entry != null; entry = in.getNextEntry())
{
-                File file = new File(target, entry.getName());
-                if (entry.isDirectory()) {
-                    file.mkdirs();
-                } else {
-                    if (!entry.getName().equals("META-INF/startup-jar")) {
-                        file.getParentFile().mkdirs();
-                        OutputStream out = new FileOutputStream(file);
-                        try {
-                            int count;
-                            while ((count = in.read(buffer)) > 0) {
-                                out.write(buffer, 0, count);
-                                
-                                }
-                            } finally {
-                            IOUtils.flush(out);
-                            out.close();
-                        }
-                        in.closeEntry();
-                    }
-                }
-        }}
-            
-        catch (IOException e) {
-            FileUtils.recursiveDelete(target);
-            throw e;
-        } finally {
-            try {
-                in.close();
-            } catch (IOException e) {
-                //Ignore
-            }           
-        }
-    }
 
     public static String removeExtension(String name, String extension) {
         if (name.endsWith(extension)) {



Mime
View raw message