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

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

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

origin: hierynomus/sshj

public void remove(String filename)
    throws IOException {
  doRequest(
      newRequest(PacketType.REMOVE).putString(filename, sub.getRemoteCharset())
  ).ensureStatusPacketIsOK();
}
origin: hierynomus/sshj

public void removeDir(String path)
    throws IOException {
  doRequest(
      newRequest(PacketType.RMDIR).putString(path, sub.getRemoteCharset())
  ).ensureStatusIs(Response.StatusCode.OK);
}
origin: hierynomus/sshj

protected FileAttributes stat(PacketType pt, String path)
    throws IOException {
  return doRequest(newRequest(pt).putString(path, sub.getRemoteCharset()))
      .ensurePacketTypeIs(PacketType.ATTRS)
      .readFileAttributes();
}
origin: hierynomus/sshj

public void setAttributes(String path, FileAttributes attrs)
    throws IOException {
  doRequest(
      newRequest(PacketType.SETSTAT).putString(path, sub.getRemoteCharset()).putFileAttributes(attrs)
  ).ensureStatusPacketIsOK();
}
origin: hierynomus/sshj

public String canonicalize(String path)
    throws IOException {
  return readSingleName(
      doRequest(
          newRequest(PacketType.REALPATH).putString(path, sub.getRemoteCharset())
      ), sub.getRemoteCharset());
}
origin: hierynomus/sshj

public void makeDir(String path, FileAttributes attrs)
    throws IOException {
  doRequest(newRequest(PacketType.MKDIR).putString(path, sub.getRemoteCharset()).putFileAttributes(attrs)).ensureStatusPacketIsOK();
}
origin: hierynomus/sshj

public RemoteDirectory openDir(String path)
    throws IOException {
  final byte[] handle = doRequest(
      newRequest(PacketType.OPENDIR).putString(path, sub.getRemoteCharset())
  ).ensurePacketTypeIs(PacketType.HANDLE).readBytes();
  return new RemoteDirectory(this, path, handle);
}
origin: hierynomus/sshj

public String readLink(String path)
    throws IOException {
  if (operativeVersion < 3)
    throw new SFTPException("READLINK is not supported in SFTPv" + operativeVersion);
  return readSingleName(
      doRequest(
          newRequest(PacketType.READLINK).putString(path, sub.getRemoteCharset())
      ), sub.getRemoteCharset());
}
origin: hierynomus/sshj

public void symlink(String linkpath, String targetpath)
    throws IOException {
  if (operativeVersion < 3)
    throw new SFTPException("SYMLINK is not supported in SFTPv" + operativeVersion);
  doRequest(
      newRequest(PacketType.SYMLINK).putString(linkpath, sub.getRemoteCharset()).putString(targetpath, sub.getRemoteCharset())
  ).ensureStatusPacketIsOK();
}
origin: hierynomus/sshj

public void rename(String oldPath, String newPath)
    throws IOException {
  if (operativeVersion < 1)
    throw new SFTPException("RENAME is not supported in SFTPv" + operativeVersion);
  doRequest(
      newRequest(PacketType.RENAME).putString(oldPath, sub.getRemoteCharset()).putString(newPath, sub.getRemoteCharset())
  ).ensureStatusPacketIsOK();
}
origin: hierynomus/sshj

public RemoteFile open(String path, Set<OpenMode> modes, FileAttributes fa)
    throws IOException {
  final byte[] handle = doRequest(
      newRequest(PacketType.OPEN).putString(path, sub.getRemoteCharset()).putUInt32(OpenMode.toMask(modes)).putFileAttributes(fa)
  ).ensurePacketTypeIs(PacketType.HANDLE).readBytes();
  return new RemoteFile(this, path, handle);
}
origin: net.schmizz/sshj

public void setAttributes(String path, FileAttributes attrs)
    throws IOException {
  doRequest(
      newRequest(PacketType.SETSTAT).putString(path).putFileAttributes(attrs)
  ).ensureStatusPacketIsOK();
}
origin: com.hierynomus/sshj

public void removeDir(String path)
    throws IOException {
  doRequest(
      newRequest(PacketType.RMDIR).putString(path, sub.getRemoteCharset())
  ).ensureStatusIs(Response.StatusCode.OK);
}
origin: com.hierynomus/sshj

public void setAttributes(String path, FileAttributes attrs)
    throws IOException {
  doRequest(
      newRequest(PacketType.SETSTAT).putString(path, sub.getRemoteCharset()).putFileAttributes(attrs)
  ).ensureStatusPacketIsOK();
}
origin: net.schmizz/sshj

public void rename(String oldPath, String newPath)
    throws IOException {
  if (operativeVersion < 1)
    throw new SFTPException("RENAME is not supported in SFTPv" + operativeVersion);
  doRequest(
      newRequest(PacketType.RENAME).putString(oldPath).putString(newPath)
  ).ensureStatusPacketIsOK();
}
origin: com.hierynomus/sshj

public RemoteDirectory openDir(String path)
    throws IOException {
  final byte[] handle = doRequest(
      newRequest(PacketType.OPENDIR).putString(path, sub.getRemoteCharset())
  ).ensurePacketTypeIs(PacketType.HANDLE).readBytes();
  return new RemoteDirectory(this, path, handle);
}
origin: com.hierynomus/sshj

public String readLink(String path)
    throws IOException {
  if (operativeVersion < 3)
    throw new SFTPException("READLINK is not supported in SFTPv" + operativeVersion);
  return readSingleName(
      doRequest(
          newRequest(PacketType.READLINK).putString(path, sub.getRemoteCharset())
      ), sub.getRemoteCharset());
}
origin: com.hierynomus/sshj

public void symlink(String linkpath, String targetpath)
    throws IOException {
  if (operativeVersion < 3)
    throw new SFTPException("SYMLINK is not supported in SFTPv" + operativeVersion);
  doRequest(
      newRequest(PacketType.SYMLINK).putString(linkpath, sub.getRemoteCharset()).putString(targetpath, sub.getRemoteCharset())
  ).ensureStatusPacketIsOK();
}
origin: com.hierynomus/sshj

public void rename(String oldPath, String newPath)
    throws IOException {
  if (operativeVersion < 1)
    throw new SFTPException("RENAME is not supported in SFTPv" + operativeVersion);
  doRequest(
      newRequest(PacketType.RENAME).putString(oldPath, sub.getRemoteCharset()).putString(newPath, sub.getRemoteCharset())
  ).ensureStatusPacketIsOK();
}
origin: net.schmizz/sshj

public RemoteFile open(String path, Set<OpenMode> modes, FileAttributes fa)
    throws IOException {
  final String handle = doRequest(
      newRequest(PacketType.OPEN).putString(path).putUInt32(OpenMode.toMask(modes)).putFileAttributes(fa)
  ).ensurePacketTypeIs(PacketType.HANDLE).readString();
  return new RemoteFile(this, path, handle);
}
net.schmizz.sshj.sftpSFTPEnginedoRequest

Popular methods of SFTPEngine

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

Popular in Java

  • Reading from database using SQL prepared statement
  • onRequestPermissionsResult (Fragment)
  • addToBackStack (FragmentTransaction)
  • setContentView (Activity)
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • 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