One more issue.
Currently FileUtil.fullyDelete(myDir) comes out stopping deletion of other files/directories if it is unable to delete a file/dir(say because of not having permissions to delete that file/dir) anywhere under myDir. This is because we return from method if the recursive call "if(!fullyDelete())
" fails at any level of recursion.
Shouldn't it continue with deletion of other files/dirs continuing in the for loop instead of returning false here ? We can just set a boolean to false in this if() and can continue the for loop sothat return value of fullyDelete() is correct always.
For example, if we have myDir/subdir1/file1, myDir/subdir2/file2 and if fullyDelete() tries to delete file1 first and could not delete it(because subDir1 has nonwritable permissions), then fullyDelete() currently comes out without deleting file2 and subdir2.
I guess fullyDelete() should delete as many files as possible(similar to 'rm -rf').