@Override
    public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException {
        try {
            final AttributedList<Path> children = new AttributedList<>();
            ListFolderResult result;
            this.parse(directory, listener, children, result = new DbxUserFilesRequests(session.getClient(directory)).listFolder(containerService.getKey(directory)));
            // If true, then there are more entries available. Pass the cursor to list_folder/continue to retrieve the rest.
            while(result.getHasMore()) {
                this.parse(directory, listener, children, result = new DbxUserFilesRequests(session.getClient(directory)).listFolderContinue(result.getCursor()));
            }
            return children;
        }
        catch(DbxException e) {
            throw new DropboxExceptionMappingService().map("Listing directory {0} failed", e, directory);
        }
    }
@Test
    public void testListHome() throws Exception {
        final AttributedList<Path> list = new DropboxListService(session).list(new Path("/", EnumSet.of(Path.Type.directory, Path.Type.volume)), new DisabledListProgressListener());
        assertNotSame(AttributedList.emptyList(), list);
        for(Path f : list) {
            assertEquals(f.attributes(), new DropboxAttributesFinderFeature(session).find(f));
        }
    }