@Override public void download(String source, LocalDestFile dest) throws IOException { final PathComponents pathComponents = engine.getPathHelper().getComponents(source); final FileAttributes attributes = engine.stat(source); new Downloader().download(getTransferListener(), new RemoteResourceInfo(pathComponents, attributes), dest); }
final RemoteResourceInfo inf = new RemoteResourceInfo(comps, attrs); if (!(".".equals(name) || "..".equals(name)) && (filter == null || filter.accept(inf))) { rri.add(inf);
@Override public void download(String source, LocalDestFile dest) throws IOException { final PathComponents pathComponents = engine.getPathHelper().getComponents(source); final FileAttributes attributes = engine.stat(source); new Downloader().download(getTransferListener(), new RemoteResourceInfo(pathComponents, attributes), dest); }
@Override public void download(String source, LocalDestFile dest) throws IOException { final PathComponents pathComponents = engine.getPathHelper().getComponents(source); final FileAttributes attributes = engine.stat(source); new Downloader().download(getTransferListener(), new RemoteResourceInfo(pathComponents, attributes), dest); }
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 RemoteResourceInfo inf = new RemoteResourceInfo(comps, attrs); if (!(".".equals(name) || "..".equals(name)) && (filter == null || filter.accept(inf))) { rri.add(inf);