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

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

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

origin: hierynomus/sshj

public RemoteFile open(String filename, Set<OpenMode> modes)
    throws IOException {
  return open(filename, modes, FileAttributes.EMPTY);
}
origin: hierynomus/sshj

public RemoteFile open(String filename, Set<OpenMode> mode, FileAttributes attrs)
    throws IOException {
  log.debug("Opening `{}`", filename);
  return engine.open(filename, mode, attrs);
}
origin: hierynomus/sshj

public RemoteFile open(String filename)
    throws IOException {
  return open(filename, EnumSet.of(OpenMode.READ));
}
origin: hierynomus/sshj

rf = sftp.open(file.getPath(), EnumSet.of(OpenMode.WRITE, OpenMode.CREAT));
byte[] data = new byte[8192];
new Random(53).nextBytes(data);
rf = sftp.open(file.getPath());
InputStream rs = rf.new ReadAheadRemoteFileInputStream(16 /*maxUnconfirmedReads*/);
origin: hierynomus/sshj

RemoteFile.RemoteFileOutputStream rfos = null;
try {
  rf = engine.open(adjusted, EnumSet.of(OpenMode.WRITE, OpenMode.CREAT, OpenMode.TRUNC));
  fis = local.getInputStream();
  rfos = rf.new RemoteFileOutputStream(0, 16);
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: com.hierynomus/sshj

public RemoteFile open(String filename, Set<OpenMode> modes)
    throws IOException {
  return open(filename, modes, FileAttributes.EMPTY);
}
origin: net.schmizz/sshj

public RemoteFile open(String filename, Set<OpenMode> modes)
    throws IOException {
  return open(filename, modes, FileAttributes.EMPTY);
}
origin: net.schmizz/sshj

public RemoteFile open(String filename, Set<OpenMode> mode, FileAttributes attrs)
    throws IOException {
  log.debug("Opening `{}`", filename);
  return engine.open(filename, mode, attrs);
}
origin: com.hierynomus/sshj

public RemoteFile open(String filename, Set<OpenMode> mode, FileAttributes attrs)
    throws IOException {
  log.debug("Opening `{}`", filename);
  return engine.open(filename, mode, attrs);
}
origin: net.schmizz/sshj

public RemoteFile open(String filename)
    throws IOException {
  return open(filename, EnumSet.of(OpenMode.READ));
}
origin: com.hierynomus/sshj

public RemoteFile open(String filename)
    throws IOException {
  return open(filename, EnumSet.of(OpenMode.READ));
}
origin: io.brooklyn/brooklyn-core

@Override
public InputStream create() throws Exception {
  sftp = acquire(sftpConnection);
  return new CloseFtpChannelOnCloseInputStream(
      sftp.getSFTPEngine().open(path).getInputStream(), sftp);
}
origin: jclouds/legacy-jclouds

@Override
public Payload create() throws Exception {
  sftp = acquire(sftpConnection);
  return Payloads.newInputStreamPayload(new CloseFtpChannelOnCloseInputStream(sftp.getSFTPEngine().open(path)
      .getInputStream(), sftp));
}
origin: org.jclouds.driver/jclouds-sshj

@Override
public Payload create() throws Exception {
  sftp = acquire(sftpConnection);
  return Payloads.newInputStreamPayload(new CloseFtpChannelOnCloseInputStream(sftp.getSFTPEngine().open(path)
      .getInputStream(), sftp));
}
origin: io.cloudsoft.jclouds.driver/jclouds-sshj

@Override
public Payload create() throws Exception {
  sftp = acquire(sftpConnection);
  return Payloads.newInputStreamPayload(new CloseFtpChannelOnCloseInputStream(sftp.getSFTPEngine().open(path)
      .getInputStream(), sftp));
}
origin: com.amysta.jclouds.driver/jclouds-sshj

@Override
public Payload create() throws Exception {
  sftp = acquire(sftpConnection);
  final RemoteFile remoteFile = sftp.getSFTPEngine().open(path);
  final InputStream in = remoteFile.new RemoteFileInputStream() {
   @Override
   public void close() throws IOException {
     try {
      super.close();
     } finally {
      remoteFile.close();
     }
   }
  };
  return Payloads.newInputStreamPayload(new CloseFtpChannelOnCloseInputStream(in, sftp));
}
origin: apache/jclouds

@Override
public Payload create() throws Exception {
  sftp = acquire(sftpConnection);
  final RemoteFile remoteFile = sftp.getSFTPEngine().open(path);
  final InputStream in = remoteFile.new RemoteFileInputStream() {
   @Override
   public void close() throws IOException {
     try {
      super.close();
     } finally {
      remoteFile.close();
     }
   }
  };
  return Payloads.newInputStreamPayload(new CloseFtpChannelOnCloseInputStream(in, sftp));
}
origin: iterate-ch/cyberduck

@Override
public Path touch(final Path file, final TransferStatus status) throws BackgroundException {
  if(file.isFile()) {
    try {
      final FileAttributes attrs;
      if(Permission.EMPTY != status.getPermission()) {
        attrs = new FileAttributes.Builder().withPermissions(Integer.parseInt(status.getPermission().getMode(), 8)).build();
      }
      else {
        attrs = FileAttributes.EMPTY;
      }
      final RemoteFile handle = session.sftp().open(file.getAbsolute(),
        EnumSet.of(OpenMode.CREAT, OpenMode.TRUNC, OpenMode.WRITE), attrs);
      handle.close();
    }
    catch(IOException e) {
      throw new SFTPExceptionMappingService().map("Cannot create file {0}", e, file);
    }
  }
  return new Path(file.getParent(), file.getName(), file.getType(), new SFTPAttributesFinderFeature(session).find(file));
}
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.sftpSFTPEngineopen

Popular methods of SFTPEngine

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

Popular in Java

  • Finding current android device location
  • setRequestProperty (URLConnection)
  • getApplicationContext (Context)
  • getSharedPreferences (Context)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • ImageIO (javax.imageio)
  • CodeWhisperer alternatives
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