Use JsonCache correctly, couldn't list all changes.

This commit is contained in:
DNx5
2016-06-28 21:36:58 +07:00
parent 874869cef8
commit 145747505f
17 changed files with 185 additions and 152 deletions
@@ -22,7 +22,8 @@ public class FileUtils {
* Copy a resource file (from the JAR) to the given file if it doesn't exist.
*
* @param destinationFile The file to check and copy to (outside of JAR)
* @param resourcePath Absolute path to the resource file (path to file within JAR)
* @param resourcePath Absolute path to the resource file (path to file within JAR)
*
* @return False if the file does not exist and could not be copied, true otherwise
*/
public static boolean copyFileFromResource(File destinationFile, String resourcePath) {
@@ -49,4 +50,25 @@ public class FileUtils {
}
return false;
}
/**
* Delete a given directory and all its content.
*
* @param directory The directory to remove
*/
public static void purgeDirectory(File directory) {
if (!directory.isDirectory()) {
return;
}
File[] files = directory.listFiles();
if (files == null) {
return;
}
for (File target : files) {
if (target.isDirectory()) {
purgeDirectory(target);
}
target.delete();
}
}
}