geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r502517 - /geronimo/server/trunk/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/util/DeploymentUtil.java
Date Fri, 02 Feb 2007 06:13:50 GMT
Author: dims
Date: Thu Feb  1 22:13:50 2007
New Revision: 502517

URL: http://svn.apache.org/viewvc?view=rev&rev=502517
Log:
Fix for GERONIMO-2786 - Unable to deploy a web app to current trunk build of geronimo (rev
501640)

Modified:
    geronimo/server/trunk/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/util/DeploymentUtil.java

Modified: geronimo/server/trunk/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/util/DeploymentUtil.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/util/DeploymentUtil.java?view=diff&rev=502517&r1=502516&r2=502517
==============================================================================
--- geronimo/server/trunk/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/util/DeploymentUtil.java
(original)
+++ geronimo/server/trunk/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/util/DeploymentUtil.java
Thu Feb  1 22:13:50 2007
@@ -243,6 +243,15 @@
         }
     }
 
+    private static void createDirectory(File dir) throws IOException {
+        if (dir != null && !dir.exists()) {
+            boolean success = dir.mkdirs();
+            if (!success) {
+                throw new IOException("Cannot create directory " + dir.getAbsolutePath());
+            }
+        }
+    }
+
     public static void unzipToDirectory(ZipFile zipFile, File destDir) throws IOException
{
         Enumeration entries = zipFile.entries();
         try {
@@ -250,12 +259,10 @@
                 ZipEntry entry = (ZipEntry) entries.nextElement();
                 if (entry.isDirectory()) {
                     File dir = new File(destDir, entry.getName());
-                    boolean success = dir.mkdirs();
-                    if (!success) {
-                        throw new IOException("Cannot create directory " + dir.getAbsolutePath());
-                    }
+                    createDirectory(dir);
                 } else {
                     File file = new File(destDir, entry.getName());
+                    createDirectory(file.getParentFile());
                     OutputStream out = null;
                     InputStream in = null;
                     try {



Mime
View raw message