[jboss-cvs] JBossAS SVN: r103964 - projects/scanning/trunk/indexer/src/main/java/org/jboss/scanning/indexer/core.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Apr 14 08:49:03 EDT 2010


Author: alesj
Date: 2010-04-14 08:49:02 -0400 (Wed, 14 Apr 2010)
New Revision: 103964

Modified:
   projects/scanning/trunk/indexer/src/main/java/org/jboss/scanning/indexer/core/FileUtil.java
Log:
Update with JP's updates.

Modified: projects/scanning/trunk/indexer/src/main/java/org/jboss/scanning/indexer/core/FileUtil.java
===================================================================
--- projects/scanning/trunk/indexer/src/main/java/org/jboss/scanning/indexer/core/FileUtil.java	2010-04-14 12:43:36 UTC (rev 103963)
+++ projects/scanning/trunk/indexer/src/main/java/org/jboss/scanning/indexer/core/FileUtil.java	2010-04-14 12:49:02 UTC (rev 103964)
@@ -195,6 +195,13 @@
             InputStream in = null;
             OutputStream out = null;
 
+            // Make sure that the directory is _really_ there
+            if (copy.getParentFile() != null && !copy.getParentFile().exists())
+            {
+               if (!copy.getParentFile().mkdirs())
+                  throw new IOException("Could not create " + copy.getParentFile());
+            }
+
             try
             {
                in = new BufferedInputStream(jar.getInputStream(je));
@@ -236,11 +243,21 @@
          }
          else
          {
-            if (!copy.mkdirs())
-               throw new IOException("Could not create " + copy);
+            if (!copy.exists())
+            {
+               if (!copy.mkdirs())
+                  throw new IOException("Could not create " + copy);
+            }
+            else
+            {
+               if (!copy.isDirectory())
+                  throw new IOException(copy + " isn't a directory");
+            }
          }
       }
 
+      jar.close();
+
       return target;
    }
 




More information about the jboss-cvs-commits mailing list