private void cleanupUnzip() { try { if (unzipped != null && unzipped.exists()) { FileUtils.deleteDirsAndFiles(unzipped, true, true); } } catch (Exception e) { log.error("Cannot cleanup unzipped datas after bulk assessment", e); } }
protected void removeDevToolTests() { Locale testLocale = i18nMgr.getLocaleOrDefault("de"); // cleanup devtools source/target files // 1) source files File baseDir = I18nModule.getPropertyFilesBaseDir(testLocale, testSourceBundle); File testSFile = i18nMgr.getPropertiesFile(testLocale, testSourceBundle, baseDir); File sourcePath = testSFile.getParentFile().getParentFile(); FileUtils.deleteDirsAndFiles(sourcePath, true, true); // 2) target files baseDir = I18nModule.getPropertyFilesBaseDir(testLocale, testTargetBundle); File testTFile = i18nMgr.getPropertiesFile(testLocale, testTargetBundle, baseDir); File targetPath = testTFile.getParentFile().getParentFile(); FileUtils.deleteDirsAndFiles(targetPath, true, true); // 3) move target files baseDir = I18nModule.getPropertyFilesBaseDir(testLocale, testMoveTargetBundle); File testMFile = i18nMgr.getPropertiesFile(testLocale, testMoveTargetBundle, baseDir); File movePath = testMFile.getParentFile().getParentFile().getParentFile(); FileUtils.deleteDirsAndFiles(movePath, true, true); }
private void cleanup() { if (StringHelper.containsNonWhitespace(datas.getDataBackupFile())) { OlatRootFileImpl backupFile = new OlatRootFileImpl(datas.getDataBackupFile(), null); if (backupFile.exists()) { File dir = backupFile.getBasefile().getParentFile(); if (dir != null && dir.exists()) { FileUtils.deleteDirsAndFiles(dir, true, true); } } } cleanupUnzip(); }
@After public void tearDown() throws Exception { String testNewBundle = "org.olat.core.util.i18n.junittestdata.new"; Locale testLocale = i18nMgr.getLocaleOrDefault("de"); File baseDir = I18nModule.getPropertyFilesBaseDir(testLocale, testNewBundle); // only delete files when basedir available if (baseDir == null) return; File testFile = i18nMgr.getPropertiesFile(testLocale, testNewBundle, baseDir); // delete not only new/_i18n/LocalStrings_de.properties, delete also _i18n and new itself if (testFile.getParentFile().getParentFile().exists()) { FileUtils.deleteDirsAndFiles(testFile.getParentFile().getParentFile(), true, true); } // don't do inline translation markup i18nMgr.setMarkLocalizedStringsEnabled(null, false); // cleanup dev tools test case files removeDevToolTests(); }