问题
In a Java application, is there a way to atomically (with regards to other running processes) delete a non-empty directory?
回答1:
The OS (Windows, Unix) doesn't support this operation, but what you can do is rename the directory or even move it away and then delete it later.
来源:https://stackoverflow.com/questions/13890949/java-atomically-delete-a-non-empty-directory