diff --git a/src/main/java/org/embulk/input/sftp/SingleFileProvider.java b/src/main/java/org/embulk/input/sftp/SingleFileProvider.java index 283157a..f902d75 100644 --- a/src/main/java/org/embulk/input/sftp/SingleFileProvider.java +++ b/src/main/java/org/embulk/input/sftp/SingleFileProvider.java @@ -45,7 +45,7 @@ public InputStream openNext() throws IOException return file.getContent().getInputStream(); } catch (FileSystemException ex) { - if (++count == maxConnectionRetry) { + if (++count == maxConnectionRetry || ex.getMessage().indexOf("Permission denied") > 0) { throw ex; } log.warn("failed to connect sftp server: " + ex.getMessage(), ex);