class OneDriveSharingLinkUrlProvider implements PromptUrlProvider {

    @Override
    public DescriptiveUrl toDownloadUrl(final Path file, final Object o, final PasswordCallback callback) throws BackgroundException {
        try {
            final OneDriveItem item = session.toItem(file);
            if(null == item) {
                throw new NotfoundException(file.getAbsolute());
            }
            if(log.isDebugEnabled()) {
                log.debug(String.format("Create shared link for %s", file));
            }
            return new DescriptiveUrl(URI.create(item.createSharedLink(OneDriveSharingLink.Type.VIEW).getLink().getWebUrl()),
                DescriptiveUrl.Type.signed, MessageFormat.format(LocaleFactory.localizedString("{0} URL"), LocaleFactory.localizedString("Pre-Signed", "S3")));

        }
        catch(OneDriveAPIException e) {
            throw new GraphExceptionMappingService().map(e);
        }
        catch(IOException e) {
            throw new DefaultIOExceptionMappingService().map(e);
        }
    }

    public  OneDriveSharingLinkUrlProvider(final OneDriveSession session);

}