All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.box.sdk.sharedlink.BoxSharedLinkRequest Maven / Gradle / Ivy

The newest version!
package com.box.sdk.sharedlink;

import com.box.sdk.BoxSharedLink;

/**
 * Represents request to create shared link with permissions.
 */
public class BoxSharedLinkRequest extends AbstractSharedLinkRequest {

    /**
     * Sets the permissions associated with this shared link.
     *
     * @param canDownload whether the shared link can be downloaded.
     * @param canPreview  whether the shared link can be previewed.
     * @param canEdit whether the file shared with the link can be edited.
     * @return this request.
     */
    public BoxSharedLinkRequest permissions(boolean canDownload, boolean canPreview, boolean canEdit) {
        BoxSharedLink.Permissions permissions = new BoxSharedLink.Permissions();
        permissions.setCanDownload(canDownload);
        permissions.setCanPreview(canPreview);
        permissions.setCanEdit(canEdit);
        getLink().setPermissions(permissions);
        return this;
    }

    /**
     * Sets the permissions associated with this shared link.
     *
     * @param canDownload whether the shared link can be downloaded.
     * @param canPreview  whether the shared link can be previewed.
     * @return this request.
     */
    public BoxSharedLinkRequest permissions(boolean canDownload, boolean canPreview) {
        return this.permissions(canDownload, canPreview, false);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy