Community
Participate
Working Groups
LocalFile.mkdir has this code: file.mkdir(); if (!file.isDirectory()) throw new Exception(...) Investigate whether this isDirectory check is necessary, rather than just checking the return value of mkdir().
I remember the answer to this. mkdir() returns true only if it created the directory. So, if the directory already existed before the call, it returns false. So, to eliminate the isDirectory() call, we would have to do an exists() call instead, with the same cost. if (!file.exists()) { if (!file.mkdir()) throw new Exception(....)