Before this, revert the read permission or it won't be able to remove:

    rootDir.setReadable(true);