From 7ec17b46ac2beddc628767e734f16211e677fb8f Mon Sep 17 00:00:00 2001 From: "anh.phamtu" Date: Wed, 4 Sep 2024 15:46:03 +0700 Subject: [PATCH] DownloadFile: fix FileNotFoundExeception when download file in a folder --- sftp-connector/processes/Sftp/SftpDownloadFile.p.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sftp-connector/processes/Sftp/SftpDownloadFile.p.json b/sftp-connector/processes/Sftp/SftpDownloadFile.p.json index 6de6090..8257631 100644 --- a/sftp-connector/processes/Sftp/SftpDownloadFile.p.json +++ b/sftp-connector/processes/Sftp/SftpDownloadFile.p.json @@ -59,7 +59,10 @@ " ivy.log.debug(\"The following file: {0} will be downloaded from the server. Size: {1} bytes\", in.remoteFileName, fileData.size);", " ", " in.toFile = new File(in.remoteFileName, true);", - "", + " if(!in.toFile.getParentFile().exists()) {", + " in.toFile.getParentFile().mkdir();", + " }", + " ", " FileOutputStream fos = null;", " try {", " fos = new FileOutputStream(in.toFile.getJavaFile());",