On Wed, 9 Dec 2015 10:52:37 +0100 Eric Chatellier <chatellier@codelutin.com> wrote:
Le 09/12/2015 10:36, Tony Chemit a écrit :
Short answer no, since you don't give the code just above this one which is
if (!dir.exist()) ...
Or we could reverse condition:
if (!dir.mkdirs()) { if (!dir.exist()) { throw new IOException("Could not create directory " + dir); } }
+1 this sound better.
But, i think the second if() condition could never trigger because the first dir.mkdirs() will throw a root IOException.
What is important to me, is to be sure when leaving the method, that the directory exists. -- Tony Chemit -------------------- tél: +33 (0) 2 40 50 29 28 http://www.codelutin.com email: chemit@codelutin.com twitter: https://twitter.com/tchemit