@Override
    public DescriptiveUrl toDownloadUrl(final Path file, final Sharee sharee, final Object options, final PasswordCallback callback) throws BackgroundException {
        final Permission permission = new Permission();
        // To make a file public you will need to assign the role reader to the type anyone
        permission.setRole("reader");
        permission.setType("anyone");
        try {
            session.getClient().permissions().create(fileid.getFileId(file), permission)
                    .setSupportsAllDrives(new HostPreferences(session.getHost()).getBoolean("googledrive.teamdrive.enable")).execute();
        }
        catch(IOException e) {
            throw new DriveExceptionMappingService(fileid).map("Failure to write attributes of {0}", e, file);
        }
        return new DriveUrlProvider().toUrl(file).find(DescriptiveUrl.Type.http);
    }
@Test
    public void toDownloadUrl() throws Exception {
        final DriveFileIdProvider fileid = new DriveFileIdProvider(session);
        final Path test = new DriveTouchFeature(session, fileid).touch(
            new Path(DriveHomeFinderService.MYDRIVE_FOLDER, UUID.randomUUID().toString(), EnumSet.of(Path.Type.file)), new TransferStatus().withMime("x-application/cyberduck"));
        final DriveSharingUrlProvider provider = new DriveSharingUrlProvider(session, fileid);
        // Set web view link
        test.setAttributes(new DriveAttributesFinderFeature(session, fileid).find(test));
        assertFalse(provider.isSupported(test, Share.Type.upload));
        assertTrue(provider.isSupported(test, Share.Type.download));
        final DescriptiveUrl url = provider.toDownloadUrl(test, Share.Sharee.world, null, new DisabledPasswordCallback());
        assertNotEquals(DescriptiveUrl.EMPTY, url);
        assertNotNull(url.getUrl());
        new DriveDeleteFeature(session, fileid).delete(Collections.singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback());
    }