Source:
<code>private void assignNewImage(URI pagesDirectory, String currentPngFile) { File temporaryTifFile = null; try { temporaryTifFile = File.createTempFile("tempTif_", ".tif"); } catch (IOException e) { logger.error(e.getMessage(), e); } if (this.image != null) { try { URI tifFile = this.currentTifFolder.resolve(this.image); logger.trace("tiffconverterpfad: {}", tifFile); if (!fileService.fileExist(tifFile)) { tifFile = serviceManager.getProcessService().getImagesTifDirectory(true, this.process) .resolve(this.image); Helper.setFehlerMeldung("formularOrdner:TifFolders", "", "image " + this.image + " does not exist in folder " + this.currentTifFolder + ", using image from " + new File(serviceManager.getProcessService().getImagesTifDirectory(true, this.process)) .getName()); } try (InputStream tifFileInputStream = fileService.read(tifFile)) { if (temporaryTifFile != null) { FileUtils.copyInputStreamToFile(tifFileInputStream, temporaryTifFile); this.imageHelper.scaleFile(temporaryTifFile.toURI(), pagesDirectory.resolve(currentPngFile), this.imageSize, this.imageRotation); logger.trace("scaleFile"); } } } catch (Exception e) { Helper.setFehlerMeldung("could not getById image folder", e); <START> logger.error(e.getMessage(), e); <END> } finally { if (temporaryTifFile != null) { try { if (!fileService.delete(temporaryTifFile.toURI())) { logger.error( "Error while deleting temporary tif file: " + temporaryTifFile.getAbsolutePath()); } } catch (IOException e) { logger.error("Error while deleting temporary tif file: " + e.getMessage()); } } } } }</code><technical_language>setErrorMessage</technical_language>

Target:
private void assignNewImage(URI pagesDirectory, String currentPngFile) { File temporaryTifFile = null; try { temporaryTifFile = File.createTempFile("tempTif_", ".tif"); } catch (IOException e) { logger.error(e.getMessage(), e); } if (this.image != null) { try { URI tifFile = this.currentTifFolder.resolve(this.image); logger.trace("tiffconverterpfad: {}", tifFile); if (!fileService.fileExist(tifFile)) { tifFile = serviceManager.getProcessService().getImagesTifDirectory(true, this.process) .resolve(this.image); Helper.setFehlerMeldung("formularOrdner:TifFolders", "", "image " + this.image + " does not exist in folder " + this.currentTifFolder + ", using image from " + new File(serviceManager.getProcessService().getImagesTifDirectory(true, this.process)) .getName()); } try (InputStream tifFileInputStream = fileService.read(tifFile)) { if (temporaryTifFile != null) { FileUtils.copyInputStreamToFile(tifFileInputStream, temporaryTifFile); this.imageHelper.scaleFile(temporaryTifFile.toURI(), pagesDirectory.resolve(currentPngFile), this.imageSize, this.imageRotation); logger.trace("scaleFile"); } } } catch (IOException | ImageManipulatorException | ImageManagerException | RuntimeException e) { Helper.setErrorMessage("could not getById image folder", logger, e); } finally { if (temporaryTifFile != null) { try { if (!fileService.delete(temporaryTifFile.toURI())) { logger.error( "Error while deleting temporary tif file: " + temporaryTifFile.getAbsolutePath()); } } catch (IOException e) { logger.error("Error while deleting temporary tif file: " + e.getMessage()); } } } } }