tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andygumbre...@apache.org
Subject tomee git commit: Verbose creation
Date Wed, 03 Dec 2014 07:35:36 GMT
Repository: tomee
Updated Branches:
  refs/heads/tomee-1.7.x 7ce3cb3aa -> f649c2cf6


Verbose creation


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/f649c2cf
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/f649c2cf
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/f649c2cf

Branch: refs/heads/tomee-1.7.x
Commit: f649c2cf68e4a04d362cb4e7d19a4deaac4d80c6
Parents: 7ce3cb3
Author: andygumbrecht <andygumbrecht@apache.org>
Authored: Wed Dec 3 08:34:51 2014 +0100
Committer: andygumbrecht <andygumbrecht@apache.org>
Committed: Wed Dec 3 08:34:51 2014 +0100

----------------------------------------------------------------------
 .../java/org/apache/openejb/loader/ProvisioningUtil.java     | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/f649c2cf/container/openejb-loader/src/main/java/org/apache/openejb/loader/ProvisioningUtil.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/ProvisioningUtil.java
b/container/openejb-loader/src/main/java/org/apache/openejb/loader/ProvisioningUtil.java
index b7b033c..f4c4f6d 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/ProvisioningUtil.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/ProvisioningUtil.java
@@ -74,8 +74,10 @@ public final class ProvisioningUtil {
     }
 
     public static File cacheFile(final String path) {
-        File cacheDir = new File(SystemInstance.get().getBase().getDirectory(), cache());
-        cacheDir.mkdirs();
+        final File cacheDir = new File(SystemInstance.get().getBase().getDirectory(), cache());
+        if (!cacheDir.exists() && !cacheDir.mkdirs()) {
+            throw new RuntimeException("Failed to create the directory: " + cacheDir);
+        }
         return new File(cacheDir, path);
     }
 
@@ -242,7 +244,7 @@ public final class ProvisioningUtil {
 
         String artifactVersion;
         if (snapshotBase != null && snapshotBase.startsWith(HTTP_PREFIX) &&
version.endsWith(SNAPSHOT_SUFFIX)) {
-            final String meta = new StringBuilder(snapshotBase).append(builder.toString()).append("maven-metadata.xml").toString();
+            final String meta = snapshotBase + builder.toString() + "maven-metadata.xml";
             final URL url = new URL(meta);
             final ByteArrayOutputStream out = new ByteArrayOutputStream();
             InputStream is = null;


Mime
View raw message