/** * Processes one dump file with the given dump file processor, handling * exceptions appropriately. * * @param dumpFile * the dump file to process * @param dumpFileProcessor * the dump file processor to use */ void processDumpFile(MwDumpFile dumpFile, MwDumpFileProcessor dumpFileProcessor) { try (InputStream inputStream = dumpFile.getDumpFileStream()) { dumpFileProcessor.processDumpFileContents(inputStream, dumpFile); } catch (FileAlreadyExistsException e) { logger.error("Dump file " + dumpFile.toString() + " could not be processed since file " + e.getFile() + " already exists. Try deleting the file or dumpfile directory to attempt a new download."); } catch (IOException e) { logger.error("Dump file " + dumpFile.toString() + " could not be processed: " + e.toString()); } }
private void installLocalAddOn(AddOn ao) { File addOnFile; try { addOnFile = copyAddOnFileToLocalPluginFolder(ao); } catch (FileAlreadyExistsException e) { showWarningMessageAddOnFileAlreadyExists(e.getFile(), e.getOtherFile()); logger.warn("Unable to copy add-on, a file with the same name already exists.", e); return; } catch (IOException e) { showWarningMessageUnableToCopyAddOnFile(); logger.warn("Unable to copy add-on to local plugin folder.", e); return; } ao.setFile(addOnFile); install(ao); }
throw new IllegalStateException( "Snapshot directory should not already contain file: " + e.getFile(), e); } finally {
Files.createDirectories(Paths.get(walletPath)); } catch (FileAlreadyExistsException e) { addError(Errors.FAILURE.name(), e.getFile(), "File can not be a part of the path"); finish();