From 2c5e642009d14c2ca4faf74e8b137de478b237f0 Mon Sep 17 00:00:00 2001 From: Mathieu Baudier Date: Thu, 16 Oct 2008 20:55:11 +0000 Subject: [PATCH] Clean requests and answers from previous builds git-svn-id: https://svn.argeo.org/slc/trunk@1748 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc --- .../org/argeo/slc/detached/drivers/FileDriver.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/drivers/FileDriver.java b/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/drivers/FileDriver.java index 51fbed16c..478154cc2 100644 --- a/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/drivers/FileDriver.java +++ b/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/drivers/FileDriver.java @@ -220,6 +220,19 @@ public class FileDriver extends AbstractDriver implements DetachedClient, createIfNotExist(cleanedRequestsDir); createIfNotExist(cleanedAnswersDir); + // Clean requests and answers from previous builds + File[] remainingRequests = requestsDir.listFiles(); + for (int i = 0; i < remainingRequests.length; i++) { + FileUtils.moveFileToDirectory(remainingRequests[i], + cleanedRequestsDir, false); + } + + File[] remainingAnswers = answersDir.listFiles(); + for (int i = 0; i < remainingAnswers.length; i++) { + FileUtils.moveFileToDirectory(remainingAnswers[i], + cleanedAnswersDir, false); + } + log.info("Detached File Driver initialized on " + baseDir); } -- 2.39.5