You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by an...@apache.org on 2014/12/03 08:35:36 UTC

tomee git commit: Verbose creation

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 <an...@apache.org>
Authored: Wed Dec 3 08:34:51 2014 +0100
Committer: andygumbrecht <an...@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;


Re: tomee git commit: Verbose creation

Posted by Jonathan Gallimore <jo...@gmail.com>.
Ah, thanks for clarifying.

Jon



> On 4 Dec 2014, at 23:38, Romain Manni-Bucau <rm...@gmail.com> wrote:
> 
> No openejb-loader
> Le 5 déc. 2014 00:37, "Jonathan Gallimore" <jo...@gmail.com> a
> écrit :
> 
>> That's a 1.7 feature though, right? We still need to run on 1.6 for JavaEE
>> 6 though, so we could do this on trunk but not tomee-1.7.x. I added this
>> change originally to fix an issue with some of our tests where we were
>> referencing a file that started http:/ (one slash not two) as it hadn't
>> been resolved from central because the temp directory didn't exist. This
>> was with a view to trying to start a 1.7.2 release.
>> 
>> Jon
>> 
>> On Thu, Dec 4, 2014 at 12:57 PM, Romain Manni-Bucau <rmannibucau@gmail.com
>> wrote:
>> 
>>> instead of doing if (!tryMkdir) throw xxx; Files utility class does
>>> it. (Files.mkdir())
>>> 
>>> 
>>> Romain Manni-Bucau
>>> @rmannibucau
>>> http://www.tomitribe.com
>>> http://rmannibucau.wordpress.com
>>> https://github.com/rmannibucau
>>> 
>>> 
>>> 2014-12-03 22:59 GMT+01:00 Jonathan Gallimore <
>>> jonathan.gallimore@gmail.com>:
>>>> I'm not I follow your question, can you elaborate a little?
>>>> 
>>>> Cheers
>>>> 
>>>> Jon
>>>> 
>>>> On Wed, Dec 3, 2014 at 10:48 AM, Romain Manni-Bucau <
>>> rmannibucau@gmail.com>
>>>> wrote:
>>>> 
>>>>> don't we have Files fo rit?
>>>>> 
>>>>> 
>>>>> Romain Manni-Bucau
>>>>> @rmannibucau
>>>>> http://www.tomitribe.com
>>>>> http://rmannibucau.wordpress.com
>>>>> https://github.com/rmannibucau
>>>>> 
>>>>> 
>>>>> 
>>>>> ---------- Forwarded message ----------
>>>>> From:  <an...@apache.org>
>>>>> Date: 2014-12-03 8:35 GMT+01:00
>>>>> Subject: tomee git commit: Verbose creation
>>>>> To: commits@tomee.apache.org
>>>>> 
>>>>> 
>>>>> 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 <an...@apache.org>
>>>>> Authored: Wed Dec 3 08:34:51 2014 +0100
>>>>> Committer: andygumbrecht <an...@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;
>> 

Re: tomee git commit: Verbose creation

Posted by Romain Manni-Bucau <rm...@gmail.com>.
No openejb-loader
Le 5 déc. 2014 00:37, "Jonathan Gallimore" <jo...@gmail.com> a
écrit :

> That's a 1.7 feature though, right? We still need to run on 1.6 for JavaEE
> 6 though, so we could do this on trunk but not tomee-1.7.x. I added this
> change originally to fix an issue with some of our tests where we were
> referencing a file that started http:/ (one slash not two) as it hadn't
> been resolved from central because the temp directory didn't exist. This
> was with a view to trying to start a 1.7.2 release.
>
> Jon
>
> On Thu, Dec 4, 2014 at 12:57 PM, Romain Manni-Bucau <rmannibucau@gmail.com
> >
> wrote:
>
> > instead of doing if (!tryMkdir) throw xxx; Files utility class does
> > it. (Files.mkdir())
> >
> >
> > Romain Manni-Bucau
> > @rmannibucau
> > http://www.tomitribe.com
> > http://rmannibucau.wordpress.com
> > https://github.com/rmannibucau
> >
> >
> > 2014-12-03 22:59 GMT+01:00 Jonathan Gallimore <
> > jonathan.gallimore@gmail.com>:
> > > I'm not I follow your question, can you elaborate a little?
> > >
> > > Cheers
> > >
> > > Jon
> > >
> > > On Wed, Dec 3, 2014 at 10:48 AM, Romain Manni-Bucau <
> > rmannibucau@gmail.com>
> > > wrote:
> > >
> > >> don't we have Files fo rit?
> > >>
> > >>
> > >> Romain Manni-Bucau
> > >> @rmannibucau
> > >> http://www.tomitribe.com
> > >> http://rmannibucau.wordpress.com
> > >> https://github.com/rmannibucau
> > >>
> > >>
> > >>
> > >> ---------- Forwarded message ----------
> > >> From:  <an...@apache.org>
> > >> Date: 2014-12-03 8:35 GMT+01:00
> > >> Subject: tomee git commit: Verbose creation
> > >> To: commits@tomee.apache.org
> > >>
> > >>
> > >> 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 <an...@apache.org>
> > >> Authored: Wed Dec 3 08:34:51 2014 +0100
> > >> Committer: andygumbrecht <an...@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;
> > >>
> >
>

Re: tomee git commit: Verbose creation

Posted by Jonathan Gallimore <jo...@gmail.com>.
That's a 1.7 feature though, right? We still need to run on 1.6 for JavaEE
6 though, so we could do this on trunk but not tomee-1.7.x. I added this
change originally to fix an issue with some of our tests where we were
referencing a file that started http:/ (one slash not two) as it hadn't
been resolved from central because the temp directory didn't exist. This
was with a view to trying to start a 1.7.2 release.

Jon

On Thu, Dec 4, 2014 at 12:57 PM, Romain Manni-Bucau <rm...@gmail.com>
wrote:

> instead of doing if (!tryMkdir) throw xxx; Files utility class does
> it. (Files.mkdir())
>
>
> Romain Manni-Bucau
> @rmannibucau
> http://www.tomitribe.com
> http://rmannibucau.wordpress.com
> https://github.com/rmannibucau
>
>
> 2014-12-03 22:59 GMT+01:00 Jonathan Gallimore <
> jonathan.gallimore@gmail.com>:
> > I'm not I follow your question, can you elaborate a little?
> >
> > Cheers
> >
> > Jon
> >
> > On Wed, Dec 3, 2014 at 10:48 AM, Romain Manni-Bucau <
> rmannibucau@gmail.com>
> > wrote:
> >
> >> don't we have Files fo rit?
> >>
> >>
> >> Romain Manni-Bucau
> >> @rmannibucau
> >> http://www.tomitribe.com
> >> http://rmannibucau.wordpress.com
> >> https://github.com/rmannibucau
> >>
> >>
> >>
> >> ---------- Forwarded message ----------
> >> From:  <an...@apache.org>
> >> Date: 2014-12-03 8:35 GMT+01:00
> >> Subject: tomee git commit: Verbose creation
> >> To: commits@tomee.apache.org
> >>
> >>
> >> 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 <an...@apache.org>
> >> Authored: Wed Dec 3 08:34:51 2014 +0100
> >> Committer: andygumbrecht <an...@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;
> >>
>

Re: tomee git commit: Verbose creation

Posted by Romain Manni-Bucau <rm...@gmail.com>.
instead of doing if (!tryMkdir) throw xxx; Files utility class does
it. (Files.mkdir())


Romain Manni-Bucau
@rmannibucau
http://www.tomitribe.com
http://rmannibucau.wordpress.com
https://github.com/rmannibucau


2014-12-03 22:59 GMT+01:00 Jonathan Gallimore <jo...@gmail.com>:
> I'm not I follow your question, can you elaborate a little?
>
> Cheers
>
> Jon
>
> On Wed, Dec 3, 2014 at 10:48 AM, Romain Manni-Bucau <rm...@gmail.com>
> wrote:
>
>> don't we have Files fo rit?
>>
>>
>> Romain Manni-Bucau
>> @rmannibucau
>> http://www.tomitribe.com
>> http://rmannibucau.wordpress.com
>> https://github.com/rmannibucau
>>
>>
>>
>> ---------- Forwarded message ----------
>> From:  <an...@apache.org>
>> Date: 2014-12-03 8:35 GMT+01:00
>> Subject: tomee git commit: Verbose creation
>> To: commits@tomee.apache.org
>>
>>
>> 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 <an...@apache.org>
>> Authored: Wed Dec 3 08:34:51 2014 +0100
>> Committer: andygumbrecht <an...@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;
>>

Re: tomee git commit: Verbose creation

Posted by Jonathan Gallimore <jo...@gmail.com>.
I'm not I follow your question, can you elaborate a little?

Cheers

Jon

On Wed, Dec 3, 2014 at 10:48 AM, Romain Manni-Bucau <rm...@gmail.com>
wrote:

> don't we have Files fo rit?
>
>
> Romain Manni-Bucau
> @rmannibucau
> http://www.tomitribe.com
> http://rmannibucau.wordpress.com
> https://github.com/rmannibucau
>
>
>
> ---------- Forwarded message ----------
> From:  <an...@apache.org>
> Date: 2014-12-03 8:35 GMT+01:00
> Subject: tomee git commit: Verbose creation
> To: commits@tomee.apache.org
>
>
> 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 <an...@apache.org>
> Authored: Wed Dec 3 08:34:51 2014 +0100
> Committer: andygumbrecht <an...@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;
>

Fwd: tomee git commit: Verbose creation

Posted by Romain Manni-Bucau <rm...@gmail.com>.
don't we have Files fo rit?


Romain Manni-Bucau
@rmannibucau
http://www.tomitribe.com
http://rmannibucau.wordpress.com
https://github.com/rmannibucau



---------- Forwarded message ----------
From:  <an...@apache.org>
Date: 2014-12-03 8:35 GMT+01:00
Subject: tomee git commit: Verbose creation
To: commits@tomee.apache.org


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 <an...@apache.org>
Authored: Wed Dec 3 08:34:51 2014 +0100
Committer: andygumbrecht <an...@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;