All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pastdev.jsch.scp.ScpFileOutputStream Maven / Gradle / Ivy

Go to download

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

There is a newer version: 0.1.11
Show newest version
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 );
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy