@Test public void list() throws Exception { final AttributedList<Path> list = new DriveTeamDrivesListService(session).list(new Path("/", EnumSet.of(Path.Type.directory)), new DisabledListProgressListener()); assertTrue(list.isEmpty()); }
@Override public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException { try { final AttributedList<Path> children = new AttributedList<>(); String page = null; do { final TeamDriveList list = session.getClient().teamdrives().list() .setPageToken(page) .setPageSize(pagesize) .execute(); for(TeamDrive f : list.getTeamDrives()) { final Path child = new Path(directory, f.getName(), EnumSet.of(Path.Type.directory, Path.Type.volume), new PathAttributes().withVersionId(f.getId())); children.add(child); } listener.chunk(directory, children); page = list.getNextPageToken(); if(log.isDebugEnabled()) { log.debug(String.format("Continue with next page token %s", page)); } } while(page != null); return children; } catch(IOException e) { throw new DriveExceptionMappingService().map("Listing directory failed", e, directory); } }
DriveTeamDrivesListService implements ListService { @Override public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException { try { final AttributedList<Path> children = new AttributedList<>(); String page = null; do { final TeamDriveList list = session.getClient().teamdrives().list() .setPageToken(page) .setPageSize(pagesize) .execute(); for(TeamDrive f : list.getTeamDrives()) { final Path child = new Path(directory, f.getName(), EnumSet.of(Path.Type.directory, Path.Type.volume), new PathAttributes().withVersionId(f.getId())); children.add(child); } listener.chunk(directory, children); page = list.getNextPageToken(); if(log.isDebugEnabled()) { log.debug(String.format("Continue with next page token %s", page)); } } while(page != null); return children; } catch(IOException e) { throw new DriveExceptionMappingService().map("Listing directory failed", e, directory); } } }
DriveTeamDrivesListService implements ListService { @Override public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException { try { final AttributedList<Path> children = new AttributedList<>(); String page = null; do { final TeamDriveList list = session.getClient().teamdrives().list() .setPageToken(page) .setPageSize(pagesize) .execute(); for(TeamDrive f : list.getTeamDrives()) { final Path child = new Path(directory, f.getName(), EnumSet.of(Path.Type.directory, Path.Type.volume), new PathAttributes().withVersionId(f.getId())); children.add(child); } listener.chunk(directory, children); page = list.getNextPageToken(); if(log.isDebugEnabled()) { log.debug(String.format("Continue with next page token %s", page)); } } while(page != null); return children; } catch(IOException e) { throw new DriveExceptionMappingService().map("Listing directory failed", e, directory); } } DriveTeamDrivesListService(final DriveSession session);  DriveTeamDrivesListService(final DriveSession session, final int pagesize); }
DriveTeamDrivesListService implements ListService { @Override public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException { try { final AttributedList<Path> children = new AttributedList<>(); String page = null; do { final TeamDriveList list = session.getClient().teamdrives().list() .setPageToken(page) .setPageSize(pagesize) .execute(); for(TeamDrive f : list.getTeamDrives()) { final Path child = new Path(directory, f.getName(), EnumSet.of(Path.Type.directory, Path.Type.volume), new PathAttributes().withVersionId(f.getId())); children.add(child); } listener.chunk(directory, children); page = list.getNextPageToken(); if(log.isDebugEnabled()) { log.debug(String.format("Continue with next page token %s", page)); } } while(page != null); return children; } catch(IOException e) { throw new DriveExceptionMappingService().map("Listing directory failed", e, directory); } } DriveTeamDrivesListService(final DriveSession session);  DriveTeamDrivesListService(final DriveSession session, final int pagesize); @Override AttributedList<Path> list(final Path directory, final ListProgressListener listener); }
DriveTeamDrivesListService implements ListService { @Override public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException { try { final AttributedList<Path> children = new AttributedList<>(); String page = null; do { final TeamDriveList list = session.getClient().teamdrives().list() .setPageToken(page) .setPageSize(pagesize) .execute(); for(TeamDrive f : list.getTeamDrives()) { final Path child = new Path(directory, f.getName(), EnumSet.of(Path.Type.directory, Path.Type.volume), new PathAttributes().withVersionId(f.getId())); children.add(child); } listener.chunk(directory, children); page = list.getNextPageToken(); if(log.isDebugEnabled()) { log.debug(String.format("Continue with next page token %s", page)); } } while(page != null); return children; } catch(IOException e) { throw new DriveExceptionMappingService().map("Listing directory failed", e, directory); } } DriveTeamDrivesListService(final DriveSession session);  DriveTeamDrivesListService(final DriveSession session, final int pagesize); @Override AttributedList<Path> list(final Path directory, final ListProgressListener listener);  }