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

com.box.boxjavalibv2.requests.ThumbnailRequest Maven / Gradle / Ivy

There is a newer version: 3.2.1
Show newest version
package com.box.boxjavalibv2.requests;

import com.box.boxjavalibv2.IBoxConfig;
import com.box.boxjavalibv2.jsonparsing.IBoxJSONParser;
import com.box.boxjavalibv2.requests.requestobjects.BoxImageRequestObject;
import com.box.restclientv2.RestMethod;
import com.box.restclientv2.exceptions.BoxRestException;
import com.box.restclientv2.requestsbase.DefaultBoxRequest;

/**
 * Request to get thumbnail.
 */
public class ThumbnailRequest extends DefaultBoxRequest {

    private final static String URI = "/files/%s/thumbnail.%s";

    public ThumbnailRequest(final IBoxConfig config, final IBoxJSONParser parser, final String fileId, final String fileExtension,
        final BoxImageRequestObject requestObject) throws BoxRestException {
        super(config, parser, getUri(fileId, fileExtension), RestMethod.GET, requestObject);
    }

    /**
     * Get uri.
     * 
     * @param fileId
     *            id of the file
     * @param fileExtension
     *            extension of the requested preview
     * @return uri
     */
    public static String getUri(String fileId, String fileExtension) {
        return String.format(URI, fileId, fileExtension);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy