public Response ensureStatusPacketIsOK() throws SFTPException { return ensurePacketTypeIs(PacketType.STATUS).ensureStatusIs(StatusCode.OK); }
private static byte[] readSingleNameAsBytes(Response res) throws IOException { res.ensurePacketTypeIs(PacketType.NAME); if (res.readUInt32AsInt() == 1) return res.readStringAsBytes(); else throw new SFTPException("Unexpected data in " + res.getType() + " packet"); }
public FileAttributes fetchAttributes() throws IOException { return requester.request(newRequest(PacketType.FSTAT)) .retrieve(requester.getTimeoutMs(), TimeUnit.MILLISECONDS) .ensurePacketTypeIs(PacketType.ATTRS) .readFileAttributes(); }
protected FileAttributes stat(PacketType pt, String path) throws IOException { return doRequest(newRequest(pt).putString(path, sub.getRemoteCharset())) .ensurePacketTypeIs(PacketType.ATTRS) .readFileAttributes(); }
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); }
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); }
public Response ensureStatusPacketIsOK() throws SFTPException { return ensurePacketTypeIs(PacketType.STATUS).ensureStatusIs(StatusCode.OK); }
public Response ensureStatusPacketIsOK() throws SFTPException { return ensurePacketTypeIs(PacketType.STATUS).ensureStatusIs(StatusCode.OK); }
protected static String readSingleName(Response res) throws IOException { res.ensurePacketTypeIs(PacketType.NAME); if (res.readUInt32AsInt() == 1) return res.readString(); else throw new SFTPException("Unexpected data in " + res.getType() + " packet"); }
private static byte[] readSingleNameAsBytes(Response res) throws IOException { res.ensurePacketTypeIs(PacketType.NAME); if (res.readUInt32AsInt() == 1) return res.readStringAsBytes(); else throw new SFTPException("Unexpected data in " + res.getType() + " packet"); }
protected FileAttributes stat(PacketType pt, String path) throws IOException { return doRequest(newRequest(pt).putString(path)) .ensurePacketTypeIs(PacketType.ATTRS) .readFileAttributes(); }
public FileAttributes fetchAttributes() throws IOException { return requester.request(newRequest(PacketType.FSTAT)) .retrieve(requester.getTimeoutMs(), TimeUnit.MILLISECONDS) .ensurePacketTypeIs(PacketType.ATTRS) .readFileAttributes(); }
public RemoteDirectory openDir(String path) throws IOException { final String handle = doRequest( newRequest(PacketType.OPENDIR).putString(path) ).ensurePacketTypeIs(PacketType.HANDLE).readString(); return new RemoteDirectory(this, path, handle); }
public FileAttributes fetchAttributes() throws IOException { return requester.request(newRequest(PacketType.FSTAT)) .retrieve(requester.getTimeoutMs(), TimeUnit.MILLISECONDS) .ensurePacketTypeIs(PacketType.ATTRS) .readFileAttributes(); }
protected FileAttributes stat(PacketType pt, String path) throws IOException { return doRequest(newRequest(pt).putString(path, sub.getRemoteCharset())) .ensurePacketTypeIs(PacketType.ATTRS) .readFileAttributes(); }
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); }
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); }
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); }