oscerd commented on code in PR #10272: URL: https://github.com/apache/camel/pull/10272#discussion_r1219844972
########## components/camel-jira/src/main/java/org/apache/camel/component/jira/FileConverter.java: ########## @@ -34,20 +35,13 @@ private FileConverter() { @Converter public static File genericToFile(GenericFile<File> genericFile, Exchange exchange) throws IOException { Object body = genericFile.getBody(); - File file; + File file = null; + Path path; if (body instanceof byte[]) { byte[] bos = (byte[]) body; - String destDir = System.getProperty("java.io.tmpdir"); - if (destDir != null && !destDir.endsWith(File.separator)) { - destDir += File.separator; - } - file = new File(destDir, genericFile.getFileName()); - if (!file.getCanonicalPath().startsWith(destDir)) { - throw new IOException("File is not jailed to the destination directory"); - } - Files.write(file.toPath(), bos, StandardOpenOption.CREATE); - // delete the temporary file on exit, as other routing may need the file for post processing - file.deleteOnExit(); + path = Files.createTempFile(genericFile.getFileName(), null, null); Review Comment: Thanks for the hint, didn't notice that. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org