embulk-output-ftp 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/build.gradle +1 -1
- data/src/main/java/org/embulk/output/ftp/FtpFileOutputPlugin.java +30 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94a88449e154fbbfecf92cd8485a113593f18a25
|
4
|
+
data.tar.gz: aa3623b5ecbf40b048c64d45048e4701ecaf0a2f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fff7e207c69d760a2eaf7928c804719396a21d0d45895e9f35331304608d5c69294784ed601f7a64ac087abedb3923b9b5e5e154f43da35e7db04142757ddfa5
|
7
|
+
data.tar.gz: 8947a389dc42ca8a90b15b6b9856b3a4bb22b52307431cfb0916238830ba056d7c9853d902f9a45c1a6a9a0be7592d8a3cd17136be15a27136c6af224f37b712
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
## 0.1.7 - 2017-02-24
|
2
|
+
|
3
|
+
* [maintenance] Don't retry when Code:550(Permission denied) error happens [#13](https://github.com/embulk/embulk-output-ftp/pull/13)
|
4
|
+
|
1
5
|
## 0.1.6 - 2016-09-09
|
2
6
|
|
3
7
|
* [maintenance] Fix NullPointerException at FtpFileOutput.getRemoteDirectory() method [#12](https://github.com/embulk/embulk-output-ftp/pull/12)
|
data/build.gradle
CHANGED
@@ -18,6 +18,7 @@ import org.embulk.config.ConfigSource;
|
|
18
18
|
import org.embulk.config.Task;
|
19
19
|
import org.embulk.config.TaskReport;
|
20
20
|
import org.embulk.config.TaskSource;
|
21
|
+
import org.embulk.config.UserDataException;
|
21
22
|
import org.embulk.output.ftp.SSLPlugins.SSLPluginConfig;
|
22
23
|
import org.embulk.spi.Buffer;
|
23
24
|
import org.embulk.spi.Exec;
|
@@ -249,7 +250,15 @@ public class FtpFileOutputPlugin implements FileOutputPlugin
|
|
249
250
|
client.changeDirectory(remoteDirectory);
|
250
251
|
}
|
251
252
|
catch (FTPException e) {
|
252
|
-
|
253
|
+
try {
|
254
|
+
client.createDirectory(remoteDirectory);
|
255
|
+
}
|
256
|
+
catch (FTPException e1) {
|
257
|
+
if (e1.getCode() == 550) {
|
258
|
+
// Create directory operation failed
|
259
|
+
throw new OperationDeniedException(e1);
|
260
|
+
}
|
261
|
+
}
|
253
262
|
}
|
254
263
|
client.upload(filePath,
|
255
264
|
new BufferedInputStream(new FileInputStream(file)), 0L, 0L,
|
@@ -275,6 +284,9 @@ public class FtpFileOutputPlugin implements FileOutputPlugin
|
|
275
284
|
if (exception instanceof ConfigException) {
|
276
285
|
throw new RetryGiveupException(exception);
|
277
286
|
}
|
287
|
+
else if (exception instanceof OperationDeniedException) {
|
288
|
+
throw new ConfigException(exception);
|
289
|
+
}
|
278
290
|
String message = String.format("FTP put request failed. Retrying %d/%d after %d seconds. Message: %s",
|
279
291
|
retryCount, retryLimit, retryWait / 1000, exception.getMessage());
|
280
292
|
if (retryCount % 3 == 0) {
|
@@ -329,6 +341,23 @@ public class FtpFileOutputPlugin implements FileOutputPlugin
|
|
329
341
|
}
|
330
342
|
return parent;
|
331
343
|
}
|
344
|
+
|
345
|
+
public class OperationDeniedException extends RuntimeException implements UserDataException
|
346
|
+
{
|
347
|
+
protected OperationDeniedException()
|
348
|
+
{
|
349
|
+
}
|
350
|
+
|
351
|
+
public OperationDeniedException(String message)
|
352
|
+
{
|
353
|
+
super(message);
|
354
|
+
}
|
355
|
+
|
356
|
+
public OperationDeniedException(Throwable cause)
|
357
|
+
{
|
358
|
+
super(cause);
|
359
|
+
}
|
360
|
+
}
|
332
361
|
}
|
333
362
|
|
334
363
|
private static FTPClient newFTPClient(Logger log, PluginTask task)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embulk-output-ftp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Satoshi Akama
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -67,7 +67,7 @@ files:
|
|
67
67
|
- src/test/resources/sample_02.csv
|
68
68
|
- classpath/bcpkix-jdk15on-1.52.jar
|
69
69
|
- classpath/bcprov-jdk15on-1.52.jar
|
70
|
-
- classpath/embulk-output-ftp-0.1.
|
70
|
+
- classpath/embulk-output-ftp-0.1.7.jar
|
71
71
|
- classpath/ftp4j-1.7.2.jar
|
72
72
|
homepage: https://github.com/embulk/embulk-output-ftp
|
73
73
|
licenses:
|