public static void resetRepository() throws IOException { if (CURRENT_INTERPRETER_REPOSITORY != null) { CURRENT_INTERPRETER_REPOSITORY.clear(); } File cache = new File(ProjectProperties.REPOSITORY + File.separator + "caches"); System.err.println("Deleting cache " + cache.getName()); removeFiles(cache); }
private static void removeFiles(File file) throws IOException { if (file.exists() && file.isDirectory()) { for (File f : file.listFiles()) { removeFiles(f); } } else if (file.exists() && !file.isDirectory()) { if (!file.delete()) throw new IOException(); } }