This is an automated email from the ASF dual-hosted git repository. mattmann pushed a commit to branch gsoc18 in repository https://gitbox.apache.org/repos/asf/drat.git
commit 2d535b4947e97b725ef21c992dd2f4feac618d27 Author: Chris Mattmann <[email protected]> AuthorDate: Mon Aug 13 21:51:58 2018 -0700 delete the repo file, and also remove the clones dir. --- proteus/src/main/java/backend/ProcessDratWrapper.java | 4 ++++ proteus/src/main/java/backend/Utils.java | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/proteus/src/main/java/backend/ProcessDratWrapper.java b/proteus/src/main/java/backend/ProcessDratWrapper.java index 67db103..48af6ec 100644 --- a/proteus/src/main/java/backend/ProcessDratWrapper.java +++ b/proteus/src/main/java/backend/ProcessDratWrapper.java @@ -255,6 +255,10 @@ public class ProcessDratWrapper extends GenericProcess this.wipeSolrCore(coreName); } + resetLog.logInfo("DRAT: reset: removing repo file: ["+Utils.getResetRepoFile()+"]"); + File repoFile = new File(Utils.getResetRepoFile()); + FileUtils.forceDelete(file); + resetLog.logInfo("DRAT: reset: recursively removed: [" + Utils.getResetDirectories() + "]"); for (String dir : Utils.getResetDirectories()) { diff --git a/proteus/src/main/java/backend/Utils.java b/proteus/src/main/java/backend/Utils.java index 64cab3d..f6b7294 100644 --- a/proteus/src/main/java/backend/Utils.java +++ b/proteus/src/main/java/backend/Utils.java @@ -27,6 +27,7 @@ import java.util.Map; public class Utils { private static Map<String, String> environment = new HashMap<String, String>(); private static List<String> resetDratConstants = new ArrayList<String>(); + private static String resetRepoFile = null; static { environment.put("JAVA_HOME", PathUtils.replaceEnvVariables("[JAVA_HOME]")); environment.put("DRAT_HOME", PathUtils.replaceEnvVariables("[DRAT_HOME]")); @@ -38,12 +39,18 @@ public class Utils { String DRAT_HOME = environment.get("DRAT_HOME"); resetDratConstants.add(DRAT_HOME + "/data/archive/"); resetDratConstants.add(DRAT_HOME + "/data/jobs/"); + resetDratConstants.add(DRAT_HOME + "/data/clones/"); + resetRepoFile = DRAT_HOME + "/data/repo"; } public static Map<String, String> getEnvironment() { return environment; } + public static String getResetRepoFile(){ + return resetRepoFile; + } + public static List<String> getResetDirectories() { return resetDratConstants; }
