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(); }
final String name = res.readString(requester.sub.getRemoteCharset()); final FileAttributes attrs = res.readFileAttributes(); final PathComponents comps = requester.getPathHelper().getComponents(path, name); final RemoteResourceInfo inf = new RemoteResourceInfo(comps, attrs);
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 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 List<RemoteResourceInfo> scan(RemoteResourceFilter filter) throws IOException { List<RemoteResourceInfo> rri = new LinkedList<RemoteResourceInfo>(); loop: for (; ; ) { final Response res = requester.request(newRequest(PacketType.READDIR)) .retrieve(requester.getTimeoutMs(), TimeUnit.MILLISECONDS); switch (res.getType()) { case NAME: final int count = res.readUInt32AsInt(); for (int i = 0; i < count; i++) { final String name = res.readString(); res.readString(); // long name - IGNORED - shdve never been in the protocol final FileAttributes attrs = res.readFileAttributes(); final PathComponents comps = requester.getPathHelper().getComponents(path, name); final RemoteResourceInfo inf = new RemoteResourceInfo(comps, attrs); if (!(name.equals(".") || name.equals("..")) && (filter == null || filter.accept(inf))) rri.add(inf); } break; case STATUS: res.ensureStatusIs(StatusCode.EOF); break loop; default: throw new SFTPException("Unexpected packet: " + res.getType()); } } return rri; }
final String name = res.readString(requester.sub.getRemoteCharset()); final FileAttributes attrs = res.readFileAttributes(); final PathComponents comps = requester.getPathHelper().getComponents(path, name); final RemoteResourceInfo inf = new RemoteResourceInfo(comps, attrs);