@Override public boolean isCached(final T parent) { return proxy.isCached(parent); }
@Override public boolean isCached(final Path folder) { return delegate.isCached(this.toDecrypted(folder)); }
@Override public List<TransferItem> list(final Session<?> session, final Path directory, final Local local, final ListProgressListener listener) throws BackgroundException { if(log.isDebugEnabled()) { log.debug(String.format("List children for %s", directory)); } if(directory.isSymbolicLink() && new DownloadSymlinkResolver(roots).resolve(directory)) { if(log.isDebugEnabled()) { log.debug(String.format("Do not list children for symbolic link %s", directory)); } return Collections.emptyList(); } else { final AttributedList<Path> list; if(cache.isCached(directory)) { list = cache.get(directory); } else { list = session.getFeature(ListService.class).list(directory, listener); cache.put(directory, list); } final List<TransferItem> children = new ArrayList<TransferItem>(); // Return copy with filtered result only for(Path f : new AttributedList<Path>(list.filter(comparator, filter))) { children.add(new TransferItem(f, LocalFactory.get(local, f.getName()))); } return children; } }
protected AttributedList<TransferItem> children(final TransferItem directory) { if(null == directory) { // Root if(!cache.isCached(null)) { cache.put(null, new AttributedList<TransferItem>(transfer.getRoots())); this.filter(); } } else if(!cache.isCached(directory)) { controller.background(new WorkerBackgroundAction<List<TransferItem>>(controller, source, new TransferPromptListWorker(transfer, directory.remote, directory.local, controller) { @Override public void cleanup(final List<TransferItem> list) { cache.put(directory, new AttributedList<TransferItem>(list)); filter(); } } )); } return this.get(directory); }
@Override public AttributedList<Path> search(final Path workdir, final Filter<Path> filter, final ListProgressListener listener) throws BackgroundException { final AttributedList<Path> list; if(!cache.isCached(workdir)) { list = session.getFeature(ListService.class).list(workdir, new SearchListProgressListener(filter, listener)).filter(filter); } else { list = cache.get(workdir).filter(filter); } listener.chunk(workdir, list); return list; }
return Boolean.valueOf(container.attributes().getCustom().get(SDSAttributesFinderFeature.KEY_ENCRYPTED)); if(cache.isCached(container.getParent())) { final AttributedList<Path> list = cache.get(container.getParent()); final Path found = list.find(new SimplePathPredicate(container));
return ROOT_NODE_ID; if(cache.isCached(file.getParent())) { final AttributedList<Path> list = cache.get(file.getParent()); final Path found = list.find(new SimplePathPredicate(file));
if(!cache.isCached(item)) { log.warn(String.format("Missing entry for %s in cache", item));
protected Path search(final Path file) throws BackgroundException { final AttributedList<Path> list; if(!cache.isCached(file.getParent())) { // Do not decrypt filenames to match with input list = session._getFeature(ListService.class).list(file.getParent(), new CachingListProgressListener(cache)); } else { list = cache.get(file.getParent()); } // Search with specific version and region final Path path = list.find(new DefaultPathPredicate(file)); if(path != null) { return path; } // Try to match path only as the version might have changed in the meantime return list.find(session.getCase() == Session.Case.insensitive ? new CaseInsensitivePathPredicate(file) : new SimplePathPredicate(file)); }
@Override public String getFileid(final Path file, final ListProgressListener listener) throws BackgroundException { if(StringUtils.isNotBlank(file.attributes().getVersionId())) { return file.attributes().getVersionId(); } if(cache.isCached(file.getParent())) { final AttributedList<Path> list = cache.get(file.getParent()); final Path found = list.find(new SimplePathPredicate(file)); if(null != found) { if(StringUtils.isNotBlank(found.attributes().getVersionId())) { return this.set(file, found.attributes().getVersionId()); } } } final AttributedList<Path> list = session._getFeature(ListService.class).list(file.getParent(), listener); final Path found = list.find(new SimplePathPredicate(file)); if(null == found) { throw new NotfoundException(file.getAbsolute()); } return this.set(file, found.attributes().getVersionId()); }
return file.attributes().getVersionId(); if(cache.isCached(file.getParent())) { final AttributedList<Path> list = cache.get(file.getParent()); final Path found = list.find(new SimplePathPredicate(file)); if(cache.isCached(file.getParent())) { final AttributedList<Path> list = cache.get(file.getParent()); final Path found = list.find(new SimplePathPredicate(file));
return DriveHomeFinderService.ROOT_FOLDER_ID; if(cache.isCached(file.getParent())) { final AttributedList<Path> list = cache.get(file.getParent()); final Path found = list.find(new IgnoreTrashedPathPredicate(file));