embulk-decoder-unzip 0.1.2 → 0.1.3

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: 102affbd723ee4a9398356eadbd7fca47b480ad5
4
- data.tar.gz: 6cdc51537a8b63b225d99af80593e33c038e550c
3
+ metadata.gz: 20afa1e2038fd6b17c0b5fc22ccd539742f07f5a
4
+ data.tar.gz: c9a6a5b7e6d3c670193f37d2007f02b2f5d0a1a6
5
5
  SHA512:
6
- metadata.gz: 4df92adfe66b3aeec9ecd8bd4a422554f1992e127d7e7e17df057f21e5900c1397ba4b1bfd6e96e71b669ad3d4947c35636d961df04c3e06818a88034666d9ce
7
- data.tar.gz: f832f84ee19656949144fd62b507da09d76a0d6f8b0f2f9af17ee2d52124b847e31065918a03588937e5a23153a902b4ed1620d3fb43a9293da3c0bbf99e92c8
6
+ metadata.gz: c2659562b7e0eaac0a53b2d7e821020a1c37f3e1958fa710fbbf8462096a4bb5bf5b88075ce364da737173b72df182b8d0006c2bd708a1112982d43243d968bc
7
+ data.tar.gz: c9e2f4a445ec7c2a56da890df025425c0943b743b01db1019fcc3251ce5647a8517e45a01e1d379e0c26245483aa205d441b03edeba73bb719f2c48fc326d12e
data/README.md CHANGED
@@ -1,4 +1,5 @@
1
1
  Original code is copied from https://github.com/hata/embulk-decoder-commons-compress
2
2
 
3
- This is just an upgrade of common-compress from 1.13 to 1.20 It's a solution to the unzip error.
4
- The reason for this is to deal with unzip errors.
3
+ diffrence is below.
4
+ * upgrade common-compress from 1.13 to 1.20.
5
+ * add error handling for ZipException and IllegalArgumentException when ArchiveInputStream#getNextEntry() called.
@@ -13,7 +13,7 @@ configurations {
13
13
  provided
14
14
  }
15
15
 
16
- version = "0.1.2"
16
+ version = "0.1.3"
17
17
 
18
18
  sourceCompatibility = 1.8
19
19
  targetCompatibility = 1.8
@@ -3,6 +3,7 @@ package org.embulk.decoder.unzip;
3
3
  import java.io.IOException;
4
4
  import java.io.InputStream;
5
5
  import java.util.Iterator;
6
+ import java.util.zip.ZipException;
6
7
 
7
8
  import org.apache.commons.compress.archivers.ArchiveEntry;
8
9
  import org.apache.commons.compress.archivers.ArchiveInputStream;
@@ -60,7 +61,15 @@ class ArchiveInputStreamIterator implements Iterator {
60
61
  }
61
62
 
62
63
  while (true) {
63
- entry = ain.getNextEntry();
64
+ try {
65
+ entry = ain.getNextEntry();
66
+ } catch (ZipException ze) {
67
+ System.err.println("ZipException: " + ze.getMessage());
68
+ continue;
69
+ } catch (IllegalArgumentException ie) {
70
+ System.err.println("IllegalArgumentException: " + ie.getMessage());
71
+ continue;
72
+ }
64
73
  if (entry == null) {
65
74
  endOfArchive = true;
66
75
  return false;
@@ -48,8 +48,6 @@ public class UnzipDecoderPlugin
48
48
  @Override
49
49
  public FileInput open(TaskSource taskSource, FileInput fileInput)
50
50
  {
51
- String zipFileName = fileInput.hintOfCurrentInputFileNameForLogging().get();
52
- System.out.println(zipFileName);
53
51
  final PluginTask task = taskSource.loadTask(PluginTask.class);
54
52
 
55
53
  final FileInputInputStream files = new FileInputInputStream(fileInput);
@@ -3,6 +3,7 @@ in:
3
3
  path_prefix: /tmp/test
4
4
  decoders:
5
5
  - type: unzip
6
+ format: zip
6
7
  parser:
7
8
  charset: UTF-8
8
9
  newline: CRLF
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-decoder-unzip
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - fundoshi
@@ -50,7 +50,7 @@ files:
50
50
  - README.md
51
51
  - build.gradle
52
52
  - classpath/commons-compress-1.20.jar
53
- - classpath/embulk-decoder-unzip-0.1.2.jar
53
+ - classpath/embulk-decoder-unzip-0.1.3.jar
54
54
  - config/checkstyle/checkstyle.xml
55
55
  - config/checkstyle/default.xml
56
56
  - gradle/wrapper/gradle-wrapper.jar