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

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

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

origin: hierynomus/sshj

protected Request newRequest(PacketType type) {
  return requester.newRequest(type).putString(handle);
}
origin: hierynomus/sshj

public Request newExtendedRequest(String reqName) {
  return newRequest(PacketType.EXTENDED).putString(reqName);
}
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 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();
}
net.schmizz.sshj.sftpSFTPEnginenewRequest

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,
  • doRequest

Popular in Java

  • Reactive rest calls using spring rest template
  • getSupportFragmentManager (FragmentActivity)
  • setContentView (Activity)
  • runOnUiThread (Activity)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • JTextField (javax.swing)
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Github Copilot 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