@Test public void testChildrenEmpty() throws Exception { final Path root = new Path("/t", EnumSet.of(Path.Type.directory)) { }; Transfer t = new UploadTransfer(new Host(new TestProtocol()), root, new Local(System.getProperty("java.io.tmpdir"), UUID.randomUUID().toString())); assertTrue(t.list(new NullSession(new Host(new TestProtocol())), root, new NullLocal("t") { @Override public AttributedList<Local> list() { return AttributedList.emptyList(); } }, new DisabledListProgressListener()).isEmpty()); }
@Override public List<TransferItem> list(final Session<?> session, final Path remote, final Local directory, final ListProgressListener listener) throws BackgroundException { if(log.isDebugEnabled()) { log.debug(String.format("List children for %s", directory)); } if(directory.isSymbolicLink()) { final Symlink symlink = session.getFeature(Symlink.class); if(new UploadSymlinkResolver(symlink, roots).resolve(directory)) { if(log.isDebugEnabled()) { log.debug(String.format("Do not list children for symbolic link %s", directory)); } return Collections.emptyList(); } } final List<TransferItem> children = new ArrayList<TransferItem>(); for(Local local : directory.list().filter(comparator, filter)) { children.add(new TransferItem(new Path(remote, local.getName(), local.isDirectory() ? EnumSet.of(Path.Type.directory) : EnumSet.of(Path.Type.file)), local)); } return children; }
UploadTransfer extends Transfer { @Override public List<TransferItem> list(final Session<?> session, final Path remote, final Local directory, final ListProgressListener listener) throws BackgroundException { if(log.isDebugEnabled()) { log.debug(String.format("List children for %s", directory)); } if(directory.isSymbolicLink()) { final Symlink symlink = session.getFeature(Symlink.class); if(new UploadSymlinkResolver(symlink, roots).resolve(directory)) { if(log.isDebugEnabled()) { log.debug(String.format("Do not list children for symbolic link %s", directory)); } return Collections.emptyList(); } } final List<TransferItem> children = new ArrayList<TransferItem>(); for(Local local : directory.list().filter(comparator, filter)) { children.add(new TransferItem(new Path(remote, local.getName(), local.isDirectory() ? EnumSet.of(Path.Type.directory) : EnumSet.of(Path.Type.file)), local)); } return children; } }
UploadTransfer extends Transfer { @Override public List<TransferItem> list(final Session<?> session, final Path remote, final Local directory, final ListProgressListener listener) throws BackgroundException { if(log.isDebugEnabled()) { log.debug(String.format("List children for %s", directory)); } if(directory.isSymbolicLink()) { final Symlink symlink = session.getFeature(Symlink.class); if(new UploadSymlinkResolver(symlink, roots).resolve(directory)) { if(log.isDebugEnabled()) { log.debug(String.format("Do not list children for symbolic link %s", directory)); } return Collections.emptyList(); } } final List<TransferItem> children = new ArrayList<TransferItem>(); for(Local local : directory.list().filter(comparator, filter)) { children.add(new TransferItem(new Path(remote, local.getName(), local.isDirectory() ? EnumSet.of(Path.Type.directory) : EnumSet.of(Path.Type.file)), local)); } return children; } UploadTransfer(final Host host, final Path root, final Local local);  UploadTransfer(final Host host, final Path root, final Local local, final Filter<Local> f);  UploadTransfer(final Host host, final List<TransferItem> roots);  UploadTransfer(final Host host, final List<TransferItem> roots, final Filter<Local> f);  UploadTransfer(final Host host, final List<TransferItem> roots, final Filter<Local> f, final Comparator<Local> comparator); }
UploadTransfer extends Transfer { @Override public List<TransferItem> list(final Session<?> session, final Path remote, final Local directory, final ListProgressListener listener) throws BackgroundException { if(log.isDebugEnabled()) { log.debug(String.format("List children for %s", directory)); } if(directory.isSymbolicLink()) { final Symlink symlink = session.getFeature(Symlink.class); if(new UploadSymlinkResolver(symlink, roots).resolve(directory)) { if(log.isDebugEnabled()) { log.debug(String.format("Do not list children for symbolic link %s", directory)); } return Collections.emptyList(); } } final List<TransferItem> children = new ArrayList<TransferItem>(); for(Local local : directory.list().filter(comparator, filter)) { children.add(new TransferItem(new Path(remote, local.getName(), local.isDirectory() ? EnumSet.of(Path.Type.directory) : EnumSet.of(Path.Type.file)), local)); } return children; } UploadTransfer(final Host host, final Path root, final Local local);  UploadTransfer(final Host host, final Path root, final Local local, final Filter<Local> f);  UploadTransfer(final Host host, final List<TransferItem> roots);  UploadTransfer(final Host host, final List<TransferItem> roots, final Filter<Local> f);  UploadTransfer(final Host host, final List<TransferItem> roots, final Filter<Local> f, final Comparator<Local> comparator); @Override Transfer withCache(final Cache<Path> cache); Transfer withOptions(final UploadFilterOptions options); @Override Type getType(); @Override List<TransferItem> list(final Session<?> session, final Path remote,
                                   final Local directory, final ListProgressListener listener); @Override AbstractUploadFilter filter(final Session<?> source, final Session<?> destination, final TransferAction action, final ProgressListener listener); @Override TransferAction action(final Session<?> source, final Session<?> destination, final boolean resumeRequested, final boolean reloadRequested,
                                 final TransferPrompt prompt, final ListProgressListener listener); @Override void pre(final Session<?> source, final Session<?> destination, final Map<TransferItem, TransferStatus> files, final ConnectionCallback callback); @Override void post(final Session<?> source, final Session<?> destination, final Map<TransferItem, TransferStatus> files, final ConnectionCallback callback); @Override void transfer(final Session<?> source, final Session<?> destination, final Path file, final Local local, final TransferOptions options,
                         final TransferStatus status, final ConnectionCallback connectionCallback,
                         final ProgressListener listener, final StreamListener streamListener); @Override void normalize(); @Override void stop(); }
UploadTransfer extends Transfer { @Override public List<TransferItem> list(final Session<?> session, final Path remote, final Local directory, final ListProgressListener listener) throws BackgroundException { if(log.isDebugEnabled()) { log.debug(String.format("List children for %s", directory)); } if(directory.isSymbolicLink()) { final Symlink symlink = session.getFeature(Symlink.class); if(new UploadSymlinkResolver(symlink, roots).resolve(directory)) { if(log.isDebugEnabled()) { log.debug(String.format("Do not list children for symbolic link %s", directory)); } return Collections.emptyList(); } } final List<TransferItem> children = new ArrayList<TransferItem>(); for(Local local : directory.list().filter(comparator, filter)) { children.add(new TransferItem(new Path(remote, local.getName(), local.isDirectory() ? EnumSet.of(Path.Type.directory) : EnumSet.of(Path.Type.file)), local)); } return children; } UploadTransfer(final Host host, final Path root, final Local local);  UploadTransfer(final Host host, final Path root, final Local local, final Filter<Local> f);  UploadTransfer(final Host host, final List<TransferItem> roots);  UploadTransfer(final Host host, final List<TransferItem> roots, final Filter<Local> f);  UploadTransfer(final Host host, final List<TransferItem> roots, final Filter<Local> f, final Comparator<Local> comparator); @Override Transfer withCache(final Cache<Path> cache); Transfer withOptions(final UploadFilterOptions options); @Override Type getType(); @Override List<TransferItem> list(final Session<?> session, final Path remote,
                                   final Local directory, final ListProgressListener listener); @Override AbstractUploadFilter filter(final Session<?> source, final Session<?> destination, final TransferAction action, final ProgressListener listener); @Override TransferAction action(final Session<?> source, final Session<?> destination, final boolean resumeRequested, final boolean reloadRequested,
                                 final TransferPrompt prompt, final ListProgressListener listener); @Override void pre(final Session<?> source, final Session<?> destination, final Map<TransferItem, TransferStatus> files, final ConnectionCallback callback); @Override void post(final Session<?> source, final Session<?> destination, final Map<TransferItem, TransferStatus> files, final ConnectionCallback callback); @Override void transfer(final Session<?> source, final Session<?> destination, final Path file, final Local local, final TransferOptions options,
                         final TransferStatus status, final ConnectionCallback connectionCallback,
                         final ProgressListener listener, final StreamListener streamListener); @Override void normalize(); @Override void stop();  }