Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor code #21

Merged
merged 2 commits into from
Dec 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ sourceCompatibility = 1.8
targetCompatibility = 1.8

dependencies {
compile "org.embulk:embulk-core:0.8.9"
provided "org.embulk:embulk-core:0.8.9"
compile "org.embulk:embulk-core:0.9.11"
provided "org.embulk:embulk-core:0.9.11"
compile files("libs/ftp4j-1.7.2.jar")
compile 'org.embulk.input.ftp:embulk-util-ftp:0.1.6'
compile "org.bouncycastle:bcpkix-jdk15on:1.52"
testCompile "junit:junit:4.+"
testCompile "org.embulk:embulk-core:0.8.9:tests"
testCompile "org.embulk:embulk-standards:0.8.9"
testCompile "org.embulk:embulk-core:0.9.11:tests"
testCompile "org.embulk:embulk-standards:0.9.11"
}

task classpath(type: Copy, dependsOn: ["jar"]) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/embulk/output/ftp/FtpFileOutputPlugin.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.embulk.output.ftp;

import com.google.common.base.Optional;
import com.google.common.base.Throwables;
import it.sauronsoftware.ftp4j.FTPAbortedException;
import it.sauronsoftware.ftp4j.FTPClient;
Expand Down Expand Up @@ -41,6 +40,7 @@
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
import java.util.Optional;

public class FtpFileOutputPlugin implements FileOutputPlugin
{
Expand Down Expand Up @@ -405,7 +405,7 @@ private static FTPClient newFTPClient(Logger log, PluginTask task)

if (task.getUser().isPresent()) {
log.info("Logging in with user {}", task.getUser().get());
client.login(task.getUser().get(), task.getPassword().or(""));
client.login(task.getUser().get(), task.getPassword().orElse(""));
}

log.info("Using passive mode");
Expand Down