embulk-output-ftp 0.1.6 → 0.1.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1235e5dc7f3eea1852b1bb9a78f0e0f4dd99cf9d
4
- data.tar.gz: 8b73b609b94b5d2f00a95b13aaf7d416d2716248
3
+ metadata.gz: 94a88449e154fbbfecf92cd8485a113593f18a25
4
+ data.tar.gz: aa3623b5ecbf40b048c64d45048e4701ecaf0a2f
5
5
  SHA512:
6
- metadata.gz: cd0b1ffc89da7fd8e8a0a204503b3fc6bfb6d71760054a3708e6691e87d5c8ab75e5ce5075d64ab54e0925fadb18c0d05c4d2132ad6967757934b09ea7fe2f7c
7
- data.tar.gz: bd01eb4835cbced4fb699b9a78bf2dbef3eba47461870ed8974ebbbd46a470b0ff4c48260e5079b8ce794a89f44b13b6d55d5619612cf792446425507e4db04d
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
@@ -14,7 +14,7 @@ configurations {
14
14
  provided
15
15
  }
16
16
 
17
- version = "0.1.6"
17
+ version = "0.1.7"
18
18
 
19
19
  sourceCompatibility = 1.7
20
20
  targetCompatibility = 1.7
@@ -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
- client.createDirectory(remoteDirectory);
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.6
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: 2016-09-09 00:00:00.000000000 Z
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.6.jar
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: