Package com.iland.core.web.rest.api
Interface DownloadResource
@Path("/downloads")
@Consumes("application/json")
@Produces("application/vnd.ilandcloud.api.v1.0+json")
public interface DownloadResource
Download Resource V1.
- Author:
- Nick Kasprzak
-
Method Summary
Modifier and TypeMethodDescriptionjavax.ws.rs.core.ResponsedownloadPreparedDownload(String token, String byteRange) Download a file that was previously prepared for download.downloadReport(String reportUuid, String filename) Download a report for the given file uuid.
-
Method Details
-
downloadReport
@GET @Path("/reports/{reportUuid}") InputStream downloadReport(@PathParam("reportUuid") String reportUuid, @QueryParam("filename") String filename) Download a report for the given file uuid.- Parameters:
reportUuid- report uuidfilename- filename for downloaded file- Returns:
- the report
-
downloadPreparedDownload
@GET @Path("/prepared-downloads/{token}") @Produces("application/vnd.ilandcloud.api.v1.0+octet-stream") javax.ws.rs.core.Response downloadPreparedDownload(@PathParam("token") String token, @HeaderParam("Range") String byteRange) Download a file that was previously prepared for download. The token is an opaque, HMAC-signed string returned in thedownload_tokenattribute of the prepare-download task; it both identifies the file and authorizes the request, so the URL is safe to embed in an HTML<a href>. Supports resumable downloads via the HTTPRangeheader.- Parameters:
token- the prepared-download token from the prepare taskbyteRange- the byte range if resuming a download, ornullto download the whole file- Returns:
- the full file (200) or a byte range (206 Partial Content)
-