com.pastdev.jsch.scp.ScpFileOutputStream Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jsch-extension Show documentation
Show all versions of jsch-extension Show documentation
A set of extensions on top of JSch providing a full SCP protocol implementation, tunneling including multi-hop, a Java 7 FileSystem like implementation for Java 6 and remote command execution
package com.pastdev.jsch.scp;
import java.io.IOException;
import java.io.OutputStream;
import com.jcraft.jsch.JSchException;
import com.pastdev.jsch.SessionFactory;
public class ScpFileOutputStream extends OutputStream {
private ScpOutputStream outputStream;
ScpFileOutputStream( SessionFactory sessionFactory, String directory, ScpEntry scpEntry ) throws JSchException, IOException {
this.outputStream = new ScpOutputStream( sessionFactory, directory, CopyMode.FILE_ONLY );
this.outputStream.putNextEntry( scpEntry );
}
@Override
public void close() throws IOException {
outputStream.closeEntry();
outputStream.close();
}
@Override
public void write( int b ) throws IOException {
outputStream.write( b );
}
}