Vinetos

Delete folder

Aug 10th, 2015
310
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. static public boolean deleteWorld(File path){
  2. if(path.exists()){
  3. final File[] files = path.listFiles();
  4. File execpt = new File("stats");
  5. for(final File file2 : files){
  6. if(file2 == execpt){
  7. }else{
  8. if(file2.isDirectory()){
  9. deleteWorld(file2);
  10. }else{
  11. file2.delete();
  12. }
  13. }
  14. }
  15. }
  16. return (path.delete());
  17. }
Advertisement
Add Comment
Please, Sign In to add comment