class 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);
        }
    }

    public  SharepointListService(final SharepointSession session, final IdProvider idProvider);

}