src/main/java/org/embulk/output/sftp/SftpUtils.java in embulk-output-sftp-0.2.1 vs src/main/java/org/embulk/output/sftp/SftpUtils.java in embulk-output-sftp-0.2.2

- old
+ new

@@ -1,9 +1,8 @@ package org.embulk.output.sftp; import com.google.common.annotations.VisibleForTesting; -import com.google.common.base.Function; import com.google.common.base.Throwables; import org.apache.commons.vfs2.FileObject; import org.apache.commons.vfs2.FileSystemException; import org.apache.commons.vfs2.FileSystemOptions; import org.apache.commons.vfs2.impl.DefaultFileSystemManager; @@ -18,19 +17,19 @@ import org.embulk.spi.util.RetryExecutor.RetryGiveupException; import org.embulk.spi.util.RetryExecutor.Retryable; import org.slf4j.Logger; import java.io.BufferedOutputStream; -import java.io.Closeable; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.URI; import java.net.URISyntaxException; import java.util.concurrent.TimeUnit; +import java.util.function.Function; import java.util.regex.Pattern; import static org.embulk.output.sftp.SftpFileOutputPlugin.PluginTask; import static org.embulk.spi.util.RetryExecutor.retryExecutor; @@ -94,10 +93,10 @@ builder.setUserDirIsRoot(fsOptions, task.getUserDirIsRoot()); builder.setTimeout(fsOptions, task.getSftpConnectionTimeout() * 1000); builder.setStrictHostKeyChecking(fsOptions, "no"); if (task.getSecretKeyFilePath().isPresent()) { IdentityInfo identityInfo = new IdentityInfo( - new File((task.getSecretKeyFilePath().transform(localFileToPathString()).get())), + new File((task.getSecretKeyFilePath().map(localFileToPathString()).get())), task.getSecretKeyPassphrase().getBytes() ); builder.setIdentityInfo(fsOptions, identityInfo); logger.info("set identity: {}", task.getSecretKeyFilePath().get()); }