@Test public void testListGroups() throws Exception { new SharepointListService(session, new GraphFileIdProvider(session)).list(SharepointListService.GROUPS_NAME, new DisabledListProgressListener()); }
@Override public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException { if(directory.isRoot()) { final AttributedList<Path> list = new AttributedList<>(); list.add(DEFAULT_NAME); list.add(GROUPS_NAME); listener.chunk(directory, list); return list; } else { if(DEFAULT_NAME.equals(directory)) { return new GraphDrivesListService(session).list(directory, listener); } else if(GROUPS_NAME.equals(directory)) { return new SharepointGroupListService(session).list(directory, listener); } else if(GROUPS_NAME.equals(directory.getParent())) { return new SharepointGroupDrivesListService(session, idProvider).list(directory, listener); } return new GraphItemListService(session).list(directory, listener); } }
SharepointListService implements ListService { @Override public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException { if(directory.isRoot()) { final AttributedList<Path> list = new AttributedList<>(); list.add(DEFAULT_NAME); list.add(GROUPS_NAME); listener.chunk(directory, list); return list; } else { if(DEFAULT_NAME.equals(directory)) { return new GraphDrivesListService(session).list(directory, listener); } else if(GROUPS_NAME.equals(directory)) { return new SharepointGroupListService(session).list(directory, listener); } else if(GROUPS_NAME.equals(directory.getParent())) { return new SharepointGroupDrivesListService(session, idProvider).list(directory, listener); } return new GraphItemListService(session).list(directory, listener); } } }
SharepointListService implements ListService { @Override public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException { if(directory.isRoot()) { final AttributedList<Path> list = new AttributedList<>(); list.add(DEFAULT_NAME); list.add(GROUPS_NAME); listener.chunk(directory, list); return list; } else { if(DEFAULT_NAME.equals(directory)) { return new GraphDrivesListService(session).list(directory, listener); } else if(GROUPS_NAME.equals(directory)) { return new SharepointGroupListService(session).list(directory, listener); } else if(GROUPS_NAME.equals(directory.getParent())) { return new SharepointGroupDrivesListService(session, idProvider).list(directory, listener); } return new GraphItemListService(session).list(directory, listener); } } SharepointListService(final SharepointSession session, final IdProvider idProvider); }
SharepointListService implements ListService { @Override public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException { if(directory.isRoot()) { final AttributedList<Path> list = new AttributedList<>(); list.add(DEFAULT_NAME); list.add(GROUPS_NAME); listener.chunk(directory, list); return list; } else { if(DEFAULT_NAME.equals(directory)) { return new GraphDrivesListService(session).list(directory, listener); } else if(GROUPS_NAME.equals(directory)) { return new SharepointGroupListService(session).list(directory, listener); } else if(GROUPS_NAME.equals(directory.getParent())) { return new SharepointGroupDrivesListService(session, idProvider).list(directory, listener); } return new GraphItemListService(session).list(directory, listener); } } SharepointListService(final SharepointSession session, final IdProvider idProvider); @Override AttributedList<Path> list(final Path directory, final ListProgressListener listener); @Override ListService withCache(final Cache<Path> cache); }
SharepointListService implements ListService { @Override public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException { if(directory.isRoot()) { final AttributedList<Path> list = new AttributedList<>(); list.add(DEFAULT_NAME); list.add(GROUPS_NAME); listener.chunk(directory, list); return list; } else { if(DEFAULT_NAME.equals(directory)) { return new GraphDrivesListService(session).list(directory, listener); } else if(GROUPS_NAME.equals(directory)) { return new SharepointGroupListService(session).list(directory, listener); } else if(GROUPS_NAME.equals(directory.getParent())) { return new SharepointGroupDrivesListService(session, idProvider).list(directory, listener); } return new GraphItemListService(session).list(directory, listener); } } SharepointListService(final SharepointSession session, final IdProvider idProvider); @Override AttributedList<Path> list(final Path directory, final ListProgressListener listener); @Override ListService withCache(final Cache<Path> cache); static final Path DEFAULT_NAME; static final Path GROUPS_NAME; }