private void storeConfigurations( Path outputDir, String batchName, Map<String, Configuration> configurations) { _logger.infof("\n*** %s***\n", batchName.toUpperCase()); AtomicInteger progressCount = _newBatch.apply(batchName, configurations.size()); // Delete any existing output, then recreate. CommonUtil.deleteDirectory(outputDir); mkdirs(outputDir); configurations .entrySet() .parallelStream() .forEach( e -> { Path currentOutputPath = outputDir.resolve(e.getKey()); serializeObject(e.getValue(), currentOutputPath); progressCount.incrementAndGet(); }); }
public static void moveByCopy(Path srcPath, Path dstPath) { if (Files.isDirectory(srcPath)) { copyDirectory(srcPath, dstPath); deleteDirectory(srcPath); } else { copyFile(srcPath, dstPath); delete(srcPath); } }
private void repairVendorConfigurations() { Path outputPath = _testrigSettings.getSerializeVendorPath(); CommonUtil.deleteDirectory(outputPath); Path testRigPath = _testrigSettings.getInputPath(); serializeVendorConfigs(testRigPath, outputPath); }
private void repairEnvironmentBgpTables() { Path answerPath = _testrigSettings.getParseEnvironmentBgpTablesAnswerPath(); Path bgpTablesOutputPath = _testrigSettings.getSerializeEnvironmentBgpTablesPath(); CommonUtil.deleteIfExists(answerPath); CommonUtil.deleteDirectory(bgpTablesOutputPath); computeEnvironmentBgpTables(); }
private void repairEnvironmentRoutingTables() { Path answerPath = _testrigSettings.getParseEnvironmentRoutingTablesAnswerPath(); Path rtOutputPath = _testrigSettings.getSerializeEnvironmentRoutingTablesPath(); CommonUtil.deleteIfExists(answerPath); CommonUtil.deleteDirectory(rtOutputPath); computeEnvironmentRoutingTables(); }
String.format("Error initializing snapshot: %s", e.getMessage()), e); } finally { CommonUtil.deleteDirectory(unzipDir);
BatfishException metadataError = new BatfishException("Could not write testrigMetadata", e); try { CommonUtil.deleteDirectory(testrigDir); } catch (Exception inner) { metadataError.addSuppressed(inner);