@Test public void testList() throws Exception { Transfer t = new CopyTransfer(new Host(new TestProtocol()), new Host(new TestProtocol()), new HashMap<>(Collections.singletonMap( new Path("/s", EnumSet.of(Path.Type.directory)), new Path("/t", EnumSet.of(Path.Type.directory))))); final NullSession session = new NullSession(new Host(new TestProtocol())) { @Override public AttributedList<Path> list(final Path file, final ListProgressListener listener) { final AttributedList<Path> children = new AttributedList<Path>(); children.add(new Path("/s/c", EnumSet.of(Path.Type.file))); return children; } }; assertEquals(Collections.singletonList(new TransferItem(new Path("/s/c", EnumSet.of(Path.Type.file)))), t.list(session, new Path("/s", EnumSet.of(Path.Type.directory)), null, new DisabledListProgressListener()) ); }
@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)); } final AttributedList<Path> list = session.getFeature(ListService.class).list(directory, listener).filter(comparator, filter); final Path copy = mapping.get(directory); for(Path p : list) { mapping.put(p, new Path(copy, p.getName(), p.getType(), p.attributes())); } final List<TransferItem> nullified = new ArrayList<TransferItem>(); for(Path p : list) { nullified.add(new TransferItem(p)); } return nullified; }
CopyTransfer extends Transfer { @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)); } final AttributedList<Path> list = session.getFeature(ListService.class).list(directory, listener).filter(comparator, filter); final Path copy = mapping.get(directory); for(Path p : list) { mapping.put(p, new Path(copy, p.getName(), p.getType(), p.attributes())); } final List<TransferItem> nullified = new ArrayList<TransferItem>(); for(Path p : list) { nullified.add(new TransferItem(p)); } return nullified; } }
CopyTransfer extends Transfer { @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)); } final AttributedList<Path> list = session.getFeature(ListService.class).list(directory, listener).filter(comparator, filter); final Path copy = mapping.get(directory); for(Path p : list) { mapping.put(p, new Path(copy, p.getName(), p.getType(), p.attributes())); } final List<TransferItem> nullified = new ArrayList<TransferItem>(); for(Path p : list) { nullified.add(new TransferItem(p)); } return nullified; } CopyTransfer(final Host source, final Host destination,
                        final Map<Path, Path> selected);  CopyTransfer(final Host source, final Host destination,
                        final Map<Path, Path> selected, final BandwidthThrottle bandwidth); }
CopyTransfer extends Transfer { @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)); } final AttributedList<Path> list = session.getFeature(ListService.class).list(directory, listener).filter(comparator, filter); final Path copy = mapping.get(directory); for(Path p : list) { mapping.put(p, new Path(copy, p.getName(), p.getType(), p.attributes())); } final List<TransferItem> nullified = new ArrayList<TransferItem>(); for(Path p : list) { nullified.add(new TransferItem(p)); } return nullified; } CopyTransfer(final Host source, final Host destination,
                        final Map<Path, Path> selected);  CopyTransfer(final Host source, final Host destination,
                        final Map<Path, Path> selected, final BandwidthThrottle bandwidth); @Override Transfer withCache(final Cache<Path> cache); @Override Type getType(); @Override Host getDestination(); @Override String getLocal(); @Override T serialize(final Serializer dict); @Override TransferAction action(final Session<?> source, final Session<?> destination, boolean resumeRequested, boolean reloadRequested,
                                 final TransferPrompt prompt, final ListProgressListener listener); @Override TransferPathFilter filter(final Session<?> source, final Session<?> destination, final TransferAction action, final ProgressListener listener); @Override List<TransferItem> list(final Session<?> session, final Path directory, final Local local,
                                   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<?> session, final Session<?> destination, final Path source, final Local n,
                         final TransferOptions options, final TransferStatus status,
                         final ConnectionCallback connectionCallback,
                         final ProgressListener listener, final StreamListener streamListener); @Override void normalize(); }
CopyTransfer extends Transfer { @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)); } final AttributedList<Path> list = session.getFeature(ListService.class).list(directory, listener).filter(comparator, filter); final Path copy = mapping.get(directory); for(Path p : list) { mapping.put(p, new Path(copy, p.getName(), p.getType(), p.attributes())); } final List<TransferItem> nullified = new ArrayList<TransferItem>(); for(Path p : list) { nullified.add(new TransferItem(p)); } return nullified; } CopyTransfer(final Host source, final Host destination,
                        final Map<Path, Path> selected);  CopyTransfer(final Host source, final Host destination,
                        final Map<Path, Path> selected, final BandwidthThrottle bandwidth); @Override Transfer withCache(final Cache<Path> cache); @Override Type getType(); @Override Host getDestination(); @Override String getLocal(); @Override T serialize(final Serializer dict); @Override TransferAction action(final Session<?> source, final Session<?> destination, boolean resumeRequested, boolean reloadRequested,
                                 final TransferPrompt prompt, final ListProgressListener listener); @Override TransferPathFilter filter(final Session<?> source, final Session<?> destination, final TransferAction action, final ProgressListener listener); @Override List<TransferItem> list(final Session<?> session, final Path directory, final Local local,
                                   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<?> session, final Session<?> destination, final Path source, final Local n,
                         final TransferOptions options, final TransferStatus status,
                         final ConnectionCallback connectionCallback,
                         final ProgressListener listener, final StreamListener streamListener); @Override void normalize();  }