@Test public void testList() throws Exception { final AttributedList<Path> list = new DropboxSharedFoldersListService(session).list( new Path("/", EnumSet.of(Path.Type.directory, Path.Type.volume)), new DisabledListProgressListener()); assertNotNull(list); assertFalse(list.isEmpty()); }
@Override public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException { try { final AttributedList<Path> children = new AttributedList<>(); ListFoldersResult listFoldersResult; this.parse(directory, listener, children, listFoldersResult = new DbxUserSharingRequests(session.getClient()).listFolders()); while(listFoldersResult.getCursor() != null) { this.parse(directory, listener, children, listFoldersResult = new DbxUserSharingRequests(session.getClient()) .listMountableFoldersContinue(listFoldersResult.getCursor())); } return children; } catch(DbxException e) { throw new DropboxExceptionMappingService().map("Listing directory {0} failed", e, directory); } }
DropboxSharedFoldersListService implements ListService { @Override public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException { try { final AttributedList<Path> children = new AttributedList<>(); ListFoldersResult listFoldersResult; this.parse(directory, listener, children, listFoldersResult = new DbxUserSharingRequests(session.getClient()).listFolders()); while(listFoldersResult.getCursor() != null) { this.parse(directory, listener, children, listFoldersResult = new DbxUserSharingRequests(session.getClient()) .listMountableFoldersContinue(listFoldersResult.getCursor())); } return children; } catch(DbxException e) { throw new DropboxExceptionMappingService().map("Listing directory {0} failed", e, directory); } } }
DropboxSharedFoldersListService implements ListService { @Override public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException { try { final AttributedList<Path> children = new AttributedList<>(); ListFoldersResult listFoldersResult; this.parse(directory, listener, children, listFoldersResult = new DbxUserSharingRequests(session.getClient()).listFolders()); while(listFoldersResult.getCursor() != null) { this.parse(directory, listener, children, listFoldersResult = new DbxUserSharingRequests(session.getClient()) .listMountableFoldersContinue(listFoldersResult.getCursor())); } return children; } catch(DbxException e) { throw new DropboxExceptionMappingService().map("Listing directory {0} failed", e, directory); } } DropboxSharedFoldersListService(final DropboxSession session); }
DropboxSharedFoldersListService implements ListService { @Override public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException { try { final AttributedList<Path> children = new AttributedList<>(); ListFoldersResult listFoldersResult; this.parse(directory, listener, children, listFoldersResult = new DbxUserSharingRequests(session.getClient()).listFolders()); while(listFoldersResult.getCursor() != null) { this.parse(directory, listener, children, listFoldersResult = new DbxUserSharingRequests(session.getClient()) .listMountableFoldersContinue(listFoldersResult.getCursor())); } return children; } catch(DbxException e) { throw new DropboxExceptionMappingService().map("Listing directory {0} failed", e, directory); } } DropboxSharedFoldersListService(final DropboxSession session); @Override AttributedList<Path> list(final Path directory, final ListProgressListener listener); }
DropboxSharedFoldersListService implements ListService { @Override public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException { try { final AttributedList<Path> children = new AttributedList<>(); ListFoldersResult listFoldersResult; this.parse(directory, listener, children, listFoldersResult = new DbxUserSharingRequests(session.getClient()).listFolders()); while(listFoldersResult.getCursor() != null) { this.parse(directory, listener, children, listFoldersResult = new DbxUserSharingRequests(session.getClient()) .listMountableFoldersContinue(listFoldersResult.getCursor())); } return children; } catch(DbxException e) { throw new DropboxExceptionMappingService().map("Listing directory {0} failed", e, directory); } } DropboxSharedFoldersListService(final DropboxSession session); @Override AttributedList<Path> list(final Path directory, final ListProgressListener listener);  }