embulk-input-sftp 0.2.8 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +1 -8
- data/CHANGELOG.md +4 -1
- data/build.gradle +1 -1
- data/src/main/java/org/embulk/input/sftp/SftpFileInput.java +16 -4
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9e0c79f27fccf85103bbbfca4fe4230e16e564d
|
4
|
+
data.tar.gz: 53b679a39dfddb526e44397781d6ef240652823f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe0c37dad8a9b545d194b01b11b34a8cb745bcc48c3b85031b30caf839d40d2f5a32ccf4cfea976a85388333c0c7417b876a34aa49fb18cd8457fe6793eee9e8
|
7
|
+
data.tar.gz: 1122f60a71055f2e390b96c5cc2fdd0b00c36607ccaf53d94301cfa21d3cf8dc09f6a0831de123c1b77942ffddc73b07c1db2f303a24ab954b6d9e38a83ce252
|
data/.travis.yml
CHANGED
@@ -1,17 +1,10 @@
|
|
1
|
-
dist: precise
|
2
1
|
language: java
|
3
2
|
|
4
3
|
jdk:
|
5
4
|
- oraclejdk8
|
6
|
-
- oraclejdk7
|
7
|
-
- openjdk7
|
8
5
|
|
9
6
|
script:
|
10
7
|
- ./gradlew test
|
11
8
|
|
12
9
|
after_success:
|
13
|
-
- ./gradlew
|
14
|
-
addons:
|
15
|
-
hosts:
|
16
|
-
- example.com
|
17
|
-
hostname: example.com
|
10
|
+
- ./gradlew check jacocoRootReport
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
|
+
## 0.2.9 - 2018-04-20
|
2
|
+
* [maintenance] Throw ConfigException when process fails with "com.jcraft.jsch.JSchException: Auth fail" [#29](https://github.com/embulk/embulk-input-sftp/pull/29)
|
3
|
+
|
1
4
|
## 0.2.8 - 2018-03-12
|
2
|
-
* [maintenance] Fix SFTP non existent last_path [#28](https://github.com/
|
5
|
+
* [maintenance] Fix SFTP non existent last_path [#28](https://github.com/embulk/embulk-input-sftp/pull/28)
|
3
6
|
|
4
7
|
## 0.2.7 - 2018-03-02
|
5
8
|
* [maintenance] Fix SFTP connection remaining problem [#27](https://github.com/sakama/embulk-input-sftp/pull/27)
|
data/build.gradle
CHANGED
@@ -3,6 +3,7 @@ package org.embulk.input.sftp;
|
|
3
3
|
import com.google.common.base.Function;
|
4
4
|
import com.google.common.base.Optional;
|
5
5
|
import com.google.common.base.Throwables;
|
6
|
+
import com.jcraft.jsch.JSchException;
|
6
7
|
import org.apache.commons.io.FilenameUtils;
|
7
8
|
import org.apache.commons.lang3.StringUtils;
|
8
9
|
import org.apache.commons.vfs2.FileObject;
|
@@ -197,9 +198,10 @@ public class SftpFileInput
|
|
197
198
|
|
198
199
|
if (task.getLastPath().isPresent() && !task.getLastPath().get().isEmpty()) {
|
199
200
|
final FileObject remotedLastPath = manager.resolveFile(getSftpFileUri(task, task.getLastPath().get()), fsOptions);
|
200
|
-
if(remotedLastPath.exists()) {
|
201
|
+
if (remotedLastPath.exists()) {
|
201
202
|
lastKey = remotedLastPath.toString();
|
202
|
-
}
|
203
|
+
}
|
204
|
+
else {
|
203
205
|
log.warn("Failed to load last_path due to non-existence in sftp, skip using last_path");
|
204
206
|
}
|
205
207
|
}
|
@@ -215,10 +217,12 @@ public class SftpFileInput
|
|
215
217
|
addFileToList(builder, f.toString(), f.getContent().getSize(), "", lastKey);
|
216
218
|
}
|
217
219
|
}
|
218
|
-
}
|
220
|
+
}
|
221
|
+
else if (files.isFile()) {
|
219
222
|
//path_prefix is a file then we just need to add that file
|
220
223
|
addFileToList(builder, files.toString(), files.getContent().getSize(), "", lastKey);
|
221
|
-
}
|
224
|
+
}
|
225
|
+
else {
|
222
226
|
// path_prefix is neither file or folder, then we scan the parent folder to file path
|
223
227
|
// that match the path_prefix basename
|
224
228
|
FileObject parent = files.getParent();
|
@@ -264,6 +268,14 @@ public class SftpFileInput
|
|
264
268
|
public void onGiveup(Exception firstException, Exception lastException)
|
265
269
|
throws RetryGiveupException
|
266
270
|
{
|
271
|
+
// Generally, Auth fail should be caught and throw ConfigException when first retry. But this library is a bit unstable.
|
272
|
+
// So we throw ConfigException after all retries are completed
|
273
|
+
if (lastException.getCause().getCause() != null) {
|
274
|
+
Throwable cause = lastException.getCause().getCause();
|
275
|
+
if (cause.getMessage().contains("Auth fail")) {
|
276
|
+
throw new ConfigException(lastException);
|
277
|
+
}
|
278
|
+
}
|
267
279
|
}
|
268
280
|
});
|
269
281
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embulk-input-sftp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Satoshi Akama
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -69,10 +69,10 @@ files:
|
|
69
69
|
- src/test/resources/id_rsa.pub
|
70
70
|
- src/test/resources/sample_01.csv
|
71
71
|
- src/test/resources/sample_02.csv
|
72
|
+
- classpath/commons-io-2.6.jar
|
72
73
|
- classpath/commons-logging-1.2.jar
|
73
74
|
- classpath/commons-vfs2-2.2.jar
|
74
|
-
- classpath/
|
75
|
-
- classpath/embulk-input-sftp-0.2.8.jar
|
75
|
+
- classpath/embulk-input-sftp-0.2.9.jar
|
76
76
|
- classpath/jsch-0.1.54.jar
|
77
77
|
homepage: https://github.com/embulk/embulk-input-sftp
|
78
78
|
licenses:
|