We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a9c6b96 commit ce25934Copy full SHA for ce25934
src/main/java/org/embulk/output/sftp/SftpFileOutput.java
@@ -216,7 +216,15 @@ private FileObject newSftpFile(URI sftpUri)
216
int count = 0;
217
while (true) {
218
try {
219
- return manager.resolveFile(sftpUri.toString(), fsOptions);
+ FileObject file = manager.resolveFile(sftpUri.toString(), fsOptions);
220
+ if (file.getParent().exists()) {
221
+ logger.info("parent directory {} exists there", file.getParent());
222
+ return file;
223
+ }
224
+ else {
225
+ logger.info("trying to create parent directory {}", file.getParent());
226
+ file.getParent().createFolder();
227
228
}
229
catch (FileSystemException e) {
230
if (++count == maxConnectionRetry) {
0 commit comments