From 6ab310ca56c75f706fefade65b0bf84580ae2a4a Mon Sep 17 00:00:00 2001 From: tc-wleite Date: Wed, 3 Jan 2024 20:58:48 -0300 Subject: [PATCH] '#2041: Reset finish flag after basic checks (already existing output). --- iped-engine/src/main/java/iped/engine/core/Manager.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/iped-engine/src/main/java/iped/engine/core/Manager.java b/iped-engine/src/main/java/iped/engine/core/Manager.java index e155967812..2b16ed3876 100644 --- a/iped-engine/src/main/java/iped/engine/core/Manager.java +++ b/iped-engine/src/main/java/iped/engine/core/Manager.java @@ -246,8 +246,6 @@ public void process() throws Exception { stats.printSystemInfo(); - Files.deleteIfExists(getFinishedFileFlag(output).toPath()); - output = output.getCanonicalFile(); args = (CmdLineArgs) caseData.getCaseObject(CmdLineArgs.class.getName()); @@ -871,6 +869,10 @@ private void prepareOutputFolder() throws Exception { throw new IOException("Fail to create folder " + output.getAbsolutePath()); //$NON-NLS-1$ } + // The finished file flag should be reset after basic checks (like already + // existing output) were done (see issue #2041). + Files.deleteIfExists(getFinishedFileFlag(output).toPath()); + if (!args.isAppendIndex() && !args.isContinue() && !args.isRestart() && args.getEvidenceToRemove() == null) { IOUtil.copyDirectory(new File(Configuration.getInstance().appRoot, "lib"), new File(output, "lib"), true); //$NON-NLS-1$ //$NON-NLS-2$ IOUtil.copyDirectory(new File(Configuration.getInstance().appRoot, "scripts"), new File(output, "scripts"), true); //$NON-NLS-1$ //$NON-NLS-2$