@Test public void testList() throws Exception { final AttributedList<Path> list = new DropboxRootListService(session).list(new DropboxHomeFinderFeature(session).find(), new DisabledListProgressListener()); assertNotNull(list); assertFalse(list.isEmpty()); }
@Override public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException { try { if(directory.isRoot()) { final FullAccount account = new DbxUserUsersRequests(session.getClient()).getCurrentAccount(); switch(account.getAccountType()) { case BUSINESS: return new DropboxListService(session).list( directory.withAttributes(new PathAttributes().withVersionId(account.getRootInfo().getRootNamespaceId())), new HomeNamespaceListProgressListener(listener, account)); } } return new DropboxListService(session).list(directory, listener); } catch(DbxException e) { throw new DropboxExceptionMappingService().map("Listing directory {0} failed", e, directory); } }
DropboxRootListService implements ListService { @Override public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException { try { if(directory.isRoot()) { final FullAccount account = new DbxUserUsersRequests(session.getClient()).getCurrentAccount(); switch(account.getAccountType()) { case BUSINESS: return new DropboxListService(session).list( directory.withAttributes(new PathAttributes().withVersionId(account.getRootInfo().getRootNamespaceId())), new HomeNamespaceListProgressListener(listener, account)); } } return new DropboxListService(session).list(directory, listener); } catch(DbxException e) { throw new DropboxExceptionMappingService().map("Listing directory {0} failed", e, directory); } } }
DropboxRootListService implements ListService { @Override public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException { try { if(directory.isRoot()) { final FullAccount account = new DbxUserUsersRequests(session.getClient()).getCurrentAccount(); switch(account.getAccountType()) { case BUSINESS: return new DropboxListService(session).list( directory.withAttributes(new PathAttributes().withVersionId(account.getRootInfo().getRootNamespaceId())), new HomeNamespaceListProgressListener(listener, account)); } } return new DropboxListService(session).list(directory, listener); } catch(DbxException e) { throw new DropboxExceptionMappingService().map("Listing directory {0} failed", e, directory); } } DropboxRootListService(final DropboxSession session); }
DropboxRootListService implements ListService { @Override public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException { try { if(directory.isRoot()) { final FullAccount account = new DbxUserUsersRequests(session.getClient()).getCurrentAccount(); switch(account.getAccountType()) { case BUSINESS: return new DropboxListService(session).list( directory.withAttributes(new PathAttributes().withVersionId(account.getRootInfo().getRootNamespaceId())), new HomeNamespaceListProgressListener(listener, account)); } } return new DropboxListService(session).list(directory, listener); } catch(DbxException e) { throw new DropboxExceptionMappingService().map("Listing directory {0} failed", e, directory); } } DropboxRootListService(final DropboxSession session); @Override AttributedList<Path> list(final Path directory, final ListProgressListener listener); }
DropboxRootListService implements ListService { @Override public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException { try { if(directory.isRoot()) { final FullAccount account = new DbxUserUsersRequests(session.getClient()).getCurrentAccount(); switch(account.getAccountType()) { case BUSINESS: return new DropboxListService(session).list( directory.withAttributes(new PathAttributes().withVersionId(account.getRootInfo().getRootNamespaceId())), new HomeNamespaceListProgressListener(listener, account)); } } return new DropboxListService(session).list(directory, listener); } catch(DbxException e) { throw new DropboxExceptionMappingService().map("Listing directory {0} failed", e, directory); } } DropboxRootListService(final DropboxSession session); @Override AttributedList<Path> list(final Path directory, final ListProgressListener listener);  }