Skip to content

Commit c44cfa6

Browse files
committed
Do not use prefix in createTempFile, and release 0.2.3
Embulk v0.9.20 started to use java.nio.file.Files.createTempFile, instead of java.io.File.createTempFile, to create a temp file. But, these two APIs had a difference when "/" is included in prefix. File.createTempFile("fooA/barA", ".tmp", new File("/tmp")); ==> Creates /tmp/barA9003569178568216717.tmp Files.createTempFile(Paths.get("/tmp"), "fooB/barB", ".tmp"); ==> Throws IllegalArgumentException The prefix is not required to create a temp file in this plugin, actually. Just removing the prefix is the simplest fix for this.
1 parent ee34ed4 commit c44cfa6

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

Diff for: .travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
sudo: required
22
language: java
33
jdk:
4-
- oraclejdk8
4+
- openjdk8
55
services:
66
- docker
77
before_script:

Diff for: build.gradle

+5-5
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,20 @@ configurations {
1717
provided
1818
}
1919

20-
version = "0.2.2"
20+
version = "0.2.3"
2121

2222
sourceCompatibility = 1.8
2323
targetCompatibility = 1.8
2424

2525
dependencies {
26-
compile "org.embulk:embulk-core:0.9.11"
27-
provided "org.embulk:embulk-core:0.9.11"
26+
compile "org.embulk:embulk-core:0.9.20"
27+
provided "org.embulk:embulk-core:0.9.20"
2828
compile files("libs/ftp4j-1.7.2.jar")
2929
compile 'org.embulk.input.ftp:embulk-util-ftp:0.1.6'
3030
compile "org.bouncycastle:bcpkix-jdk15on:1.52"
3131
testCompile "junit:junit:4.+"
32-
testCompile "org.embulk:embulk-core:0.9.11:tests"
33-
testCompile "org.embulk:embulk-standards:0.9.11"
32+
testCompile "org.embulk:embulk-core:0.9.20:tests"
33+
testCompile "org.embulk:embulk-standards:0.9.20"
3434
}
3535

3636
task classpath(type: Copy, dependsOn: ["jar"]) {

Diff for: src/main/java/org/embulk/output/ftp/FtpFileOutputPlugin.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ public void nextFile()
190190
filePath = separator + filePath;
191191
}
192192
remoteDirectory = getRemoteDirectory(filePath, separator);
193-
file = Exec.getTempFileSpace().createTempFile(filePath, "tmp");
193+
file = Exec.getTempFileSpace().createTempFile("tmp");
194194
log.info("Writing local temporary file \"{}\"", file.getAbsolutePath());
195195
output = new BufferedOutputStream(new FileOutputStream(file));
196196
}

0 commit comments

Comments
 (0)