Class BatchUploadObject

All Implemented Interfaces:
Resource, Adaptable

public class BatchUploadObject extends AbstractResource<ResourceTypeImpl>
Batch upload endpoint.

Provides the APIs listed below:

Largely inspired by the excellent Google Drive REST API documentation about resumable upload.
Since:
7.4
  • Field Details

  • Constructor Details

    • BatchUploadObject

      public BatchUploadObject()
  • Method Details

    • mapWithName

      protected Map<String,String> mapWithName(String name)
    • handlers

      @GET @Path("handlers") public jakarta.ws.rs.core.Response handlers() throws IOException
      Throws:
      IOException
    • getHandlerInfo

      @GET @Path("handlers/{handlerName}") public jakarta.ws.rs.core.Response getHandlerInfo(@PathParam("handlerName") String handlerName) throws IOException
      Throws:
      IOException
    • createNewBatch

      @POST @Path("new/{handlerName}") public jakarta.ws.rs.core.Response createNewBatch(@PathParam("handlerName") String handlerName) throws IOException
      Throws:
      IOException
    • initBatch

      @POST public jakarta.ws.rs.core.Response initBatch() throws IOException
      Throws:
      IOException
    • upload

      @POST @Path("{batchId}/{fileIdx}") public jakarta.ws.rs.core.Response upload(@Context jakarta.servlet.http.HttpServletRequest request, @PathParam("batchId") String batchId, @PathParam("fileIdx") String fileIdx) throws IOException
      Throws:
      IOException
    • uploadNoTransaction

      protected jakarta.ws.rs.core.Response uploadNoTransaction(@Context jakarta.servlet.http.HttpServletRequest request, @PathParam("batchId") String batchId, @PathParam("fileIdx") String fileIdx) throws IOException
      Throws:
      IOException
    • getUploadedSize

      protected long getUploadedSize(jakarta.servlet.http.HttpServletRequest request)
    • addBlob

      protected void addBlob(String uploadType, String batchId, String fileIdx, Blob blob, String fileName, String mimeType, long uploadedSize, int chunkCount, int uploadChunkIndex, long fileSize)
    • getBatchInfo

      @GET @Path("{batchId}") public jakarta.ws.rs.core.Response getBatchInfo(@PathParam("batchId") String batchId) throws IOException
      Throws:
      IOException
    • getFileInfo

      @GET @Path("{batchId}/{fileIdx}") public jakarta.ws.rs.core.Response getFileInfo(@PathParam("batchId") String batchId, @PathParam("fileIdx") String fileIdx) throws IOException
      Throws:
      IOException
    • cancel

      @DELETE @Path("{batchId}") public jakarta.ws.rs.core.Response cancel(@PathParam("batchId") String batchId)
    • removeFile

      @DELETE @Path("{batchId}/{fileIdx}") public jakarta.ws.rs.core.Response removeFile(@PathParam("batchId") String batchId, @PathParam("fileIdx") String fileIdx)
      Since:
      8.4
    • execute

      @POST @Produces("application/json") @Path("{batchId}/execute/{operationId}") public jakarta.ws.rs.core.Response execute(@PathParam("batchId") String batchId, @PathParam("operationId") String operationId, ExecutionRequest xreq)
    • execute

      @POST @Produces("application/json") @Path("{batchId}/{fileIdx}/execute/{operationId}") public jakarta.ws.rs.core.Response execute(@PathParam("batchId") String batchId, @PathParam("fileIdx") String fileIdx, @PathParam("operationId") String operationId, ExecutionRequest xreq)
    • getBatchExtraInfo

      @GET @Path("{batchId}/info") public jakarta.ws.rs.core.Response getBatchExtraInfo(@PathParam("batchId") String batchId) throws IOException
      Throws:
      IOException
    • refreshToken

      @POST @Path("{batchId}/refreshToken") public jakarta.ws.rs.core.Response refreshToken(@PathParam("batchId") String batchId) throws IOException
      Throws:
      IOException
      Since:
      11.1
    • complete

      @POST @Path("{batchId}/{fileIdx}/complete") public jakarta.ws.rs.core.Response complete(@PathParam("batchId") String batchId, @PathParam("fileIdx") String fileIdx, String body) throws IOException
      Throws:
      IOException
    • completeNoTransaction

      protected jakarta.ws.rs.core.Response completeNoTransaction(String batchId, String fileIdx, String body) throws IOException
      Throws:
      IOException
    • executeBatch

      protected jakarta.ws.rs.core.Response executeBatch(String batchId, String fileIdx, String operationId, jakarta.servlet.http.HttpServletRequest request, ExecutionRequest xreq)
    • getUploadWaitTimeout

      protected int getUploadWaitTimeout()
    • execute

      protected Object execute(Object blobInput, String chainOrOperationId, CoreSession session, Map<String,Object> contextParams, Map<String,Object> operationParams)
    • buildResponse

      protected jakarta.ws.rs.core.Response buildResponse(jakarta.ws.rs.core.Response.StatusType status, Object object) throws IOException
      Throws:
      IOException
    • buildResponse

      @Deprecated(since="11.2") protected jakarta.ws.rs.core.Response buildResponse(jakarta.ws.rs.core.Response.StatusType status, Object object, boolean html) throws IOException
      Deprecated.
      since 11.2, not used anymore
      Throws:
      IOException
    • buildJSONResponse

      @Deprecated(since="11.2") protected jakarta.ws.rs.core.Response buildJSONResponse(jakarta.ws.rs.core.Response.StatusType status, String message)
      Deprecated.
      since 11.2, not used anymore
    • buildHTMLResponse

      @Deprecated(since="11.2") protected jakarta.ws.rs.core.Response buildHTMLResponse(jakarta.ws.rs.core.Response.StatusType status, String message)
      Deprecated.
      since 11.2, not used anymore
    • buildTextResponse

      protected jakarta.ws.rs.core.Response buildTextResponse(jakarta.ws.rs.core.Response.StatusType status, String message)
    • buildEmptyResponse

      protected jakarta.ws.rs.core.Response buildEmptyResponse(jakarta.ws.rs.core.Response.StatusType status)
    • buildResponse

      protected jakarta.ws.rs.core.Response buildResponse(jakarta.ws.rs.core.Response.StatusType status, String type, String message)
    • getFileInfo

      protected Map<String,Object> getFileInfo(BatchFileEntry fileEntry)