Package org.nuxeo.ecm.restapi.server
Class BatchUploadObject
java.lang.Object
org.nuxeo.ecm.webengine.model.impl.AbstractResource<ResourceTypeImpl>
org.nuxeo.ecm.restapi.server.BatchUploadObject
Batch upload endpoint.
Provides the APIs listed below:
- POST /upload, see
initBatch() - POST /upload/{batchId}/{fileIdx}, see
upload(HttpServletRequest, String, String) - GET /upload/{batchId}, see
getBatchInfo(String) - GET /upload/{batchId}/{fileIdx}, see
getFileInfo(String, String) - POST /upload/{batchId}/execute/{operationId}, see
execute(String, String, ExecutionRequest) - POST /upload/{batchId}/refreshToken, see
refreshToken(String) - POST /upload/{batchId}/{fileIdx}/execute/{operationId}, see
execute(String, String, String, ExecutionRequest) - DELETE /upload/{batchId}, see
cancel(String) - DELETE /upload/{batchId}/{fileIdx}, see
removeFile(String, String)
- Since:
- 7.4
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected static final Stringprotected jakarta.servlet.http.HttpServletRequestprotected static final Stringprotected static final Stringprotected static final Stringprotected jakarta.servlet.http.HttpServletResponsestatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddBlob(String uploadType, String batchId, String fileIdx, Blob blob, String fileName, String mimeType, long uploadedSize, int chunkCount, int uploadChunkIndex, long fileSize) protected jakarta.ws.rs.core.ResponsebuildEmptyResponse(jakarta.ws.rs.core.Response.StatusType status) protected jakarta.ws.rs.core.ResponsebuildHTMLResponse(jakarta.ws.rs.core.Response.StatusType status, String message) Deprecated.since 11.2, not used anymoreprotected jakarta.ws.rs.core.ResponsebuildJSONResponse(jakarta.ws.rs.core.Response.StatusType status, String message) Deprecated.since 11.2, not used anymoreprotected jakarta.ws.rs.core.ResponsebuildResponse(jakarta.ws.rs.core.Response.StatusType status, Object object) protected jakarta.ws.rs.core.ResponsebuildResponse(jakarta.ws.rs.core.Response.StatusType status, Object object, boolean html) Deprecated.since 11.2, not used anymoreprotected jakarta.ws.rs.core.ResponsebuildResponse(jakarta.ws.rs.core.Response.StatusType status, String type, String message) protected jakarta.ws.rs.core.ResponsebuildTextResponse(jakarta.ws.rs.core.Response.StatusType status, String message) jakarta.ws.rs.core.Responsejakarta.ws.rs.core.Responseprotected jakarta.ws.rs.core.ResponsecompleteNoTransaction(String batchId, String fileIdx, String body) jakarta.ws.rs.core.ResponsecreateNewBatch(String handlerName) protected Objectexecute(Object blobInput, String chainOrOperationId, CoreSession session, Map<String, Object> contextParams, Map<String, Object> operationParams) jakarta.ws.rs.core.Responseexecute(String batchId, String fileIdx, String operationId, ExecutionRequest xreq) jakarta.ws.rs.core.Responseexecute(String batchId, String operationId, ExecutionRequest xreq) protected jakarta.ws.rs.core.ResponseexecuteBatch(String batchId, String fileIdx, String operationId, jakarta.servlet.http.HttpServletRequest request, ExecutionRequest xreq) jakarta.ws.rs.core.ResponsegetBatchExtraInfo(String batchId) jakarta.ws.rs.core.ResponsegetBatchInfo(String batchId) jakarta.ws.rs.core.ResponsegetFileInfo(String batchId, String fileIdx) getFileInfo(BatchFileEntry fileEntry) jakarta.ws.rs.core.ResponsegetHandlerInfo(String handlerName) protected longgetUploadedSize(jakarta.servlet.http.HttpServletRequest request) protected intjakarta.ws.rs.core.Responsehandlers()jakarta.ws.rs.core.ResponsemapWithName(String name) jakarta.ws.rs.core.ResponserefreshToken(String batchId) jakarta.ws.rs.core.ResponseremoveFile(String batchId, String fileIdx) jakarta.ws.rs.core.Responseprotected jakarta.ws.rs.core.ResponseuploadNoTransaction(jakarta.servlet.http.HttpServletRequest request, String batchId, String fileIdx) Methods inherited from class org.nuxeo.ecm.webengine.model.impl.AbstractResource
checkGuard, dispose, getActiveAdapter, getAdapter, getContext, getFacets, getLinks, getModule, getName, getNext, getNextSegment, getPath, getPrevious, getTemplate, getTrailingPath, getType, getURL, getView, hasFacet, initialize, initialize, isAdapter, isInstanceOf, isRoot, newAdapter, newObject, redirect, setNext, setPrevious, setRoot, toString
-
Field Details
-
REQUEST_BATCH_ID
- See Also:
-
REQUEST_FILE_IDX
- See Also:
-
OPERATION_ID
- See Also:
-
REQUEST_HANDLER_NAME
- See Also:
-
UPLOAD_TYPE_NORMAL
- See Also:
-
UPLOAD_TYPE_CHUNKED
- See Also:
-
KEY
- See Also:
-
NAME
- See Also:
-
MIMETYPE
- See Also:
-
FILE_SIZE
- See Also:
-
MD5
- See Also:
-
request
@Context protected jakarta.servlet.http.HttpServletRequest request -
response
@Context protected jakarta.servlet.http.HttpServletResponse response
-
-
Constructor Details
-
BatchUploadObject
public BatchUploadObject()
-
-
Method Details
-
mapWithName
-
handlers
- 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
- 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
-
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
-
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
-
getFileInfo
-