Tabnine Logo
SFTPEngine.getSubsystem
Code IndexAdd Tabnine to your IDE (free)

How to use
getSubsystem
method
in
net.schmizz.sshj.sftp.SFTPEngine

Best Java code snippets using net.schmizz.sshj.sftp.SFTPEngine.getSubsystem (Showing top 10 results out of 315)

origin: hierynomus/sshj

public PacketReader(SFTPEngine engine) {
  this.engine = engine;
  log = engine.getLoggerFactory().getLogger(getClass());
  this.in = engine.getSubsystem().getInputStream();
  setName("sftp reader");
}
origin: hierynomus/sshj

@Before
public void setUp() throws Exception {
  PipedOutputStream pipedout = new PipedOutputStream();
  PipedInputStream pipedin = new PipedInputStream(pipedout);
  dataout = new DataOutputStream(pipedout);
  SFTPEngine engine = Mockito.mock(SFTPEngine.class);
  Subsystem subsystem = Mockito.mock(Subsystem.class);
  Mockito.when(engine.getLoggerFactory()).thenReturn(LoggerFactory.DEFAULT);
  Mockito.when(engine.getSubsystem()).thenReturn(subsystem);
  Mockito.when(subsystem.getInputStream()).thenReturn(pipedin);
  reader = new PacketReader(engine);
}
origin: hierynomus/sshj

rfos = rf.new RemoteFileOutputStream(0, 16);
new StreamCopier(fis, rfos, engine.getLoggerFactory())
    .bufSize(engine.getSubsystem().getRemoteMaxPacketSize() - rf.getOutgoingPacketOverhead())
    .keepFlushing(false)
    .listener(listener)
origin: hierynomus/sshj

private LocalDestFile downloadFile(final StreamCopier.Listener listener,
                  final RemoteResourceInfo remote,
                  final LocalDestFile local)
    throws IOException {
  final LocalDestFile adjusted = local.getTargetFile(remote.getName());
  final RemoteFile rf = engine.open(remote.getPath());
  try {
    final RemoteFile.ReadAheadRemoteFileInputStream rfis = rf.new ReadAheadRemoteFileInputStream(16);
    final OutputStream os = adjusted.getOutputStream();
    try {
      new StreamCopier(rfis, os, engine.getLoggerFactory())
          .bufSize(engine.getSubsystem().getLocalMaxPacketSize())
          .keepFlushing(false)
          .listener(listener)
          .copy();
    } finally {
      rfis.close();
      os.close();
    }
  } finally {
    rf.close();
  }
  return adjusted;
}
origin: net.schmizz/sshj

public PacketReader(SFTPEngine engine) {
  this.engine = engine;
  this.in = engine.getSubsystem().getInputStream();
  setName("sftp reader");
}
origin: com.hierynomus/sshj

public PacketReader(SFTPEngine engine) {
  this.engine = engine;
  log = engine.getLoggerFactory().getLogger(getClass());
  this.in = engine.getSubsystem().getInputStream();
  setName("sftp reader");
}
origin: net.schmizz/sshj

private String uploadFile(final StreamCopier.Listener listener,
             final LocalSourceFile local,
             final String remote)
    throws IOException {
  final String adjusted = prepareFile(local, remote);
  final RemoteFile rf = engine.open(adjusted, EnumSet.of(OpenMode.WRITE,
                              OpenMode.CREAT,
                              OpenMode.TRUNC));
  try {
    final InputStream fis = local.getInputStream();
    final RemoteFile.RemoteFileOutputStream rfos = rf.new RemoteFileOutputStream(0, 16);
    try {
      new StreamCopier(fis, rfos)
          .bufSize(engine.getSubsystem().getRemoteMaxPacketSize() - rf.getOutgoingPacketOverhead())
          .keepFlushing(false)
          .listener(listener)
          .copy();
    } finally {
      fis.close();
      rfos.close();
    }
  } finally {
    rf.close();
  }
  return adjusted;
}
origin: com.hierynomus/sshj

rfos = rf.new RemoteFileOutputStream(0, 16);
new StreamCopier(fis, rfos, engine.getLoggerFactory())
    .bufSize(engine.getSubsystem().getRemoteMaxPacketSize() - rf.getOutgoingPacketOverhead())
    .keepFlushing(false)
    .listener(listener)
origin: net.schmizz/sshj

private LocalDestFile downloadFile(final StreamCopier.Listener listener,
                  final RemoteResourceInfo remote,
                  final LocalDestFile local)
    throws IOException {
  final LocalDestFile adjusted = local.getTargetFile(remote.getName());
  final RemoteFile rf = engine.open(remote.getPath());
  try {
    final RemoteFile.ReadAheadRemoteFileInputStream rfis = rf.new ReadAheadRemoteFileInputStream(16);
    final OutputStream os = adjusted.getOutputStream();
    try {
      new StreamCopier(rfis, os)
          .bufSize(engine.getSubsystem().getLocalMaxPacketSize())
          .keepFlushing(false)
          .listener(listener)
          .copy();
    } finally {
      rfis.close();
      os.close();
    }
  } finally {
    rf.close();
  }
  return adjusted;
}
origin: com.hierynomus/sshj

private LocalDestFile downloadFile(final StreamCopier.Listener listener,
                  final RemoteResourceInfo remote,
                  final LocalDestFile local)
    throws IOException {
  final LocalDestFile adjusted = local.getTargetFile(remote.getName());
  final RemoteFile rf = engine.open(remote.getPath());
  try {
    final RemoteFile.ReadAheadRemoteFileInputStream rfis = rf.new ReadAheadRemoteFileInputStream(16);
    final OutputStream os = adjusted.getOutputStream();
    try {
      new StreamCopier(rfis, os, engine.getLoggerFactory())
          .bufSize(engine.getSubsystem().getLocalMaxPacketSize())
          .keepFlushing(false)
          .listener(listener)
          .copy();
    } finally {
      rfis.close();
      os.close();
    }
  } finally {
    rf.close();
  }
  return adjusted;
}
net.schmizz.sshj.sftpSFTPEnginegetSubsystem

Popular methods of SFTPEngine

  • open
  • makeDir
  • stat
  • <init>
  • canonicalize
  • close
  • getOperativeProtocolVersion
  • getPathHelper
  • init
  • lstat
  • openDir
  • readLink
  • openDir,
  • readLink,
  • remove,
  • removeDir,
  • rename,
  • request,
  • setAttributes,
  • symlink,
  • doRequest

Popular in Java

  • Reading from database using SQL prepared statement
  • getResourceAsStream (ClassLoader)
  • getSharedPreferences (Context)
  • requestLocationUpdates (LocationManager)
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • JList (javax.swing)
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now