@Override
    public Set<ProfileDescription> find(final Visitor visitor) throws BackgroundException {
        if(log.isInfoEnabled()) {
            log.info(String.format("Fetch profiles from %s", session.getHost()));
        }
        final ProfileFilter filter = new ProfileFilter();
        final AttributedList<Path> list = session.getFeature(ListService.class).list(new DelegatingHomeFeature(
                new DefaultPathHomeFeature(session.getHost())).find(), new DisabledListProgressListener());
        return list.filter(filter).toStream().map(file -> visitor.visit(new RemoteProfileDescription(protocols, file,
                new LazyInitializer<Local>() {
                    @Override
                    protected Local initialize() throws ConcurrentException {
                        try {
                            final Local local = temp.create("profiles", file);
                            final TransferPathFilter filter = comparison
                                    .withFinder(new Find() {
                                        @Override
                                        public boolean find(final Path file, final ListProgressListener listener) {
                                            return true;
                                        }
                                    })
                                    .withAttributes(new AttributesFinder() {
                                        @Override
                                        public PathAttributes find(final Path file, final ListProgressListener listener) {
                                            return file.attributes();
                                        }
                                    });
                            if(filter.accept(file, local, new TransferStatus().exists(true))) {
                                final Read read = session.getFeature(Read.class);
                                if(log.isInfoEnabled()) {
                                    log.info(String.format("Download profile %s", file));
                                }
                                // Read latest version
                                try (InputStream in = read.read(file.withAttributes(new PathAttributes(file.attributes())
                                        // Read latest version
                                        .withVersionId(null)), new TransferStatus().withLength(TransferStatus.UNKNOWN_LENGTH), new DisabledConnectionCallback()); OutputStream out = local.getOutputStream(false)) {
                                    IOUtils.copy(in, out);
                                }
                            }
                            return local;
                        }
                        catch(BackgroundException | IOException e) {
                            throw new ConcurrentException(e);
                        }
                    }
                }
        ))).collect(Collectors.toSet());
    }
@Test
    public void find() throws Exception {
        final ProtocolFactory protocols = new ProtocolFactory(new HashSet<>(Arrays.asList(new TestProtocol() {
            @Override
            public String getIdentifier() {
                return "s3";
            }

            @Override
            public Type getType() {
                return Type.s3;
            }

            @Override
            public boolean isEnabled() {
                return false;
            }
        }, new TestProtocol() {
            @Override
            public String getIdentifier() {
                return "davs";
            }

            @Override
            public Type getType() {
                return Type.dav;
            }

            @Override
            public boolean isEnabled() {
                return false;
            }
        })));
        final TestProtocol protocol = new TestProtocol() {
            @Override
            public String getIdentifier() {
                return "davs";
            }

            @Override
            public Scheme getScheme() {
                return Scheme.https;
            }

            @Override
            public Type getType() {
                return Type.dav;
            }

            @Override
            public boolean isEnabled() {
                return false;
            }
        };
        final Host host = new HostParser(protocols, protocol).get("https://svn.cyberduck.io/trunk/profiles");
        final NullSession session = new NullSession(host);
        session.open(new DisabledProxyFinder(), new DisabledHostKeyCallback(), new DisabledLoginCallback(), new DisabledCancelCallback());
        final RemoteProfilesFinder finder = new RemoteProfilesFinder(session);
        final Set<ProfileDescription> stream = finder.find();
        assertTrue(stream.isEmpty());
        session.close();
    }