embulk-output-azure_blob_storage 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ccdaca1700220ec52d0b259d437f287606fa6d92
4
- data.tar.gz: da45aa15412af0702c12c1ffb8dbc01039f81137
3
+ metadata.gz: 91f151194182d73b78ec9b2b82ab9647b10678d0
4
+ data.tar.gz: cb78773244114d953c9f5b377fe3cc58ef1d4972
5
5
  SHA512:
6
- metadata.gz: d97b14a501714e14e7783d1df01930b2a47b465b4ef3a0ed96da435054062a0ca4d4249b65551e57124203aec81bd2ec8c54e41845da781ffb3f6e46caf4a98a
7
- data.tar.gz: 441367911e739ec536725211a55bc6b776ff27b7a2dec694138dd87f3c74c42a983a447238a31fbd4f9786cbdc2f65d03c48e489298ef3dc4b0a6f893a6901c8
6
+ metadata.gz: 5e14c9a755cb3ad1c5fae3ffe0e13cd74a3f926ef97218ab05cc41a990f6de1090c97ed309030615dcd3c6a08788aa90694d427ae37ea50ca0563737af8e62a4
7
+ data.tar.gz: 79f11b084a54773c1ebb56916f7977fb7714bd8a6dd9166ada5fa12a69e4c9bc0b4ccd13636869057fc985f88dfa66f3f246c00bf8444455bf6f1b76c19d054d
@@ -1,5 +1,8 @@
1
+ ## 0.1.7 - 2018-10-19
2
+ * [maintenance] Close BufferedInputStream before delete temporary file [#14](https://github.com/sakama/embulk-output-azure_blob_storage/pull/14)
3
+
1
4
  ## 0.1.6 - 2018-10-18
2
- * [maintenance] Fix bug that happens while deleting temporary files on Windows [#12](https://github.com/sakama/embulk-output-azure_blob_storage/pull/12)
5
+ * [maintenance] Fix bug that happens while deleting temporary files on Windows [#12](https://github.com/sakama/embulk-output-azure_blob_storage/pull/12)
3
6
 
4
7
  ## 0.1.5 - 2016-04-06
5
8
 
@@ -17,7 +17,7 @@ configurations {
17
17
  sourceCompatibility = 1.8
18
18
  targetCompatibility = 1.8
19
19
 
20
- version = "0.1.6"
20
+ version = "0.1.7"
21
21
 
22
22
  dependencies {
23
23
  compile "org.embulk:embulk-core:0.9.8"
@@ -162,7 +162,7 @@ public class AzureBlobStorageFileOutputPlugin
162
162
  suffix = "." + suffix;
163
163
  }
164
164
  filePath = pathPrefix + String.format(sequenceFormat, taskIndex, fileIndex) + suffix;
165
- file = Exec.getTempFileSpace().createTempFile(filePath, ".tmp");
165
+ file = Exec.getTempFileSpace().createTempFile(filePath, "tmp");
166
166
  log.info("Writing local file {}", file.getAbsolutePath());
167
167
  output = new BufferedOutputStream(new FileOutputStream(file));
168
168
  }
@@ -220,10 +220,14 @@ public class AzureBlobStorageFileOutputPlugin
220
220
  CloudBlobContainer container = client.getContainerReference(containerName);
221
221
  CloudBlockBlob blob = container.getBlockBlobReference(filePath);
222
222
  log.info("Upload start {} to {}", file.getAbsolutePath(), filePath);
223
- blob.upload(new BufferedInputStream(new FileInputStream(file)), file.length());
224
- log.info("Upload completed {} to {}", file.getAbsolutePath(), filePath);
225
- if (file.exists() && !file.delete()) {
226
- log.warn("Couldn't delete local file " + file.getAbsolutePath());
223
+ try (BufferedInputStream in = new BufferedInputStream(new FileInputStream(file))) {
224
+ blob.upload(in, file.length());
225
+ log.info("Upload completed {} to {}", file.getAbsolutePath(), filePath);
226
+ }
227
+ if (file.exists()) {
228
+ if (!file.delete()) {
229
+ log.warn("Couldn't delete local file " + file.getAbsolutePath());
230
+ }
227
231
  }
228
232
  return null;
229
233
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-output-azure_blob_storage
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: 2018-10-18 00:00:00.000000000 Z
11
+ date: 2018-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -65,8 +65,8 @@ files:
65
65
  - classpath/azure-storage-8.0.0.jar
66
66
  - classpath/guava-20.0.jar
67
67
  - classpath/azure-keyvault-core-1.0.0.jar
68
+ - classpath/embulk-output-azure_blob_storage-0.1.7.jar
68
69
  - classpath/jackson-core-2.9.4.jar
69
- - classpath/embulk-output-azure_blob_storage-0.1.6.jar
70
70
  homepage: https://github.com/embulk/embulk-output-azure_blob_storage
71
71
  licenses:
72
72
  - Apache-2.0