32 lines
No EOL
438 B
Java
32 lines
No EOL
438 B
Java
package StevenDimDoors.mod_pocketDim.helpers;
|
|
|
|
import java.io.File;
|
|
|
|
|
|
public class DeleteFolder
|
|
{
|
|
public static boolean deleteFolder(File file)
|
|
{
|
|
try
|
|
{
|
|
File[] files = file.listFiles();
|
|
|
|
if(files==null)
|
|
{
|
|
file.delete();
|
|
return true;
|
|
}
|
|
for(File inFile : files)
|
|
{
|
|
DeleteFolder.deleteFolder(inFile);
|
|
}
|
|
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
e.printStackTrace();
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
} |