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 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 uuid
      filename - 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 the download_token attribute 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 HTTP Range header.
      Parameters:
      token - the prepared-download token from the prepare task
      byteRange - the byte range if resuming a download, or null to download the whole file
      Returns:
      the full file (200) or a byte range (206 Partial Content)