@Override
    public DescriptiveUrl toDownloadUrl(final Path file, final Sharee sharee, final Void options, final PasswordCallback callback) throws BackgroundException {
        try {
            if(log.isDebugEnabled()) {
                log.debug(String.format("Create temporary link for %s", file));
            }
            // This link will expire in four hours and afterwards you will get 410 Gone.
            final String link = new DbxUserFilesRequests(session.getClient(file)).getTemporaryLink(containerService.getKey(file)).getLink();
            // Determine expiry time for URL
            final Calendar expiry = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
            expiry.add(Calendar.HOUR, 4);
            return new DescriptiveUrl(URI.create(link), DescriptiveUrl.Type.signed,
                MessageFormat.format(LocaleFactory.localizedString("{0} URL"), LocaleFactory.localizedString("Temporary", "S3"))
                    + " (" + MessageFormat.format(LocaleFactory.localizedString("Expires {0}", "S3") + ")",
                    UserDateFormatterFactory.get().getMediumFormat(expiry.getTimeInMillis()))
            );
        }
        catch(DbxException e) {
            throw new DropboxExceptionMappingService().map(e);
        }
    }
@Test
    public void testToUrl() throws Exception {
        final DropboxTemporaryUrlProvider provider = new DropboxTemporaryUrlProvider(session);
        final Path file = new Path(new DefaultHomeFinderService(session).find(), new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
        new DropboxTouchFeature(session).touch(file, new TransferStatus());
        assertNotNull(provider.toDownloadUrl(file, Share.Sharee.world, null, new DisabledPasswordCallback()).getUrl());
        new DropboxDeleteFeature(session).delete(Collections.singletonList(file), new DisabledLoginCallback(), new Delete.DisabledCallback());
    }