Class BatchUploadObject
- java.lang.Object
-
- org.nuxeo.ecm.webengine.model.impl.AbstractResource<ResourceTypeImpl>
-
- org.nuxeo.ecm.restapi.server.jaxrs.BatchUploadObject
-
public class BatchUploadObject extends AbstractResource<ResourceTypeImpl>
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
- POST /upload, see
-
-
Field Summary
Fields Modifier and Type Field Description static StringFILE_SIZEstatic StringKEYprotected static Loglogstatic StringMD5static StringMIMETYPEstatic StringNAMEprotected static StringOPERATION_IDprotected javax.servlet.http.HttpServletRequestrequestprotected static StringREQUEST_BATCH_IDprotected static StringREQUEST_FILE_IDXprotected static StringREQUEST_HANDLER_NAMEprotected javax.servlet.http.HttpServletResponseresponsestatic StringUPLOAD_TYPE_CHUNKEDstatic StringUPLOAD_TYPE_NORMAL
-
Constructor Summary
Constructors Constructor Description BatchUploadObject()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidaddBlob(String uploadType, String batchId, String fileIdx, Blob blob, String fileName, String mimeType, long uploadedSize, int chunkCount, int uploadChunkIndex, long fileSize)protected javax.ws.rs.core.ResponsebuildEmptyResponse(javax.ws.rs.core.Response.StatusType status)protected javax.ws.rs.core.ResponsebuildHTMLResponse(javax.ws.rs.core.Response.StatusType status, String message)Deprecated.since 11.2, not used anymoreprotected javax.ws.rs.core.ResponsebuildJSONResponse(javax.ws.rs.core.Response.StatusType status, String message)Deprecated.since 11.2, not used anymoreprotected javax.ws.rs.core.ResponsebuildResponse(javax.ws.rs.core.Response.StatusType status, Object object)protected javax.ws.rs.core.ResponsebuildResponse(javax.ws.rs.core.Response.StatusType status, Object object, boolean html)Deprecated.since 11.2, not used anymoreprotected javax.ws.rs.core.ResponsebuildResponse(javax.ws.rs.core.Response.StatusType status, String type, String message)protected javax.ws.rs.core.ResponsebuildTextResponse(javax.ws.rs.core.Response.StatusType status, String message)javax.ws.rs.core.Responsecancel(String batchId)javax.ws.rs.core.Responsecomplete(String batchId, String fileIdx, String body)protected javax.ws.rs.core.ResponsecompleteNoTransaction(String batchId, String fileIdx, String body)javax.ws.rs.core.ResponsecreateNewBatch(String handlerName)Objectexecute(String batchId, String fileIdx, String operationId, ExecutionRequest xreq)Objectexecute(String batchId, String operationId, ExecutionRequest xreq)protected ObjectexecuteBatch(String batchId, String fileIdx, String operationId, javax.servlet.http.HttpServletRequest request, ExecutionRequest xreq)javax.ws.rs.core.ResponsegetBatchExtraInfo(String batchId)javax.ws.rs.core.ResponsegetBatchInfo(String batchId)javax.ws.rs.core.ResponsegetFileInfo(String batchId, String fileIdx)protected Map<String,Object>getFileInfo(BatchFileEntry fileEntry)javax.ws.rs.core.ResponsegetHandlerInfo(String handlerName)protected longgetUploadedSize(javax.servlet.http.HttpServletRequest request)javax.ws.rs.core.Responsehandlers()javax.ws.rs.core.ResponseinitBatch()protected Map<String,String>mapWithName(String name)javax.ws.rs.core.ResponserefreshToken(String batchId)javax.ws.rs.core.ResponseremoveFile(String batchId, String fileIdx)javax.ws.rs.core.Responseupload(javax.servlet.http.HttpServletRequest request, String batchId, String fileIdx)protected javax.ws.rs.core.ResponseuploadNoTransaction(javax.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 Detail
-
log
protected static final Log log
-
REQUEST_BATCH_ID
protected static final String REQUEST_BATCH_ID
- See Also:
- Constant Field Values
-
REQUEST_FILE_IDX
protected static final String REQUEST_FILE_IDX
- See Also:
- Constant Field Values
-
OPERATION_ID
protected static final String OPERATION_ID
- See Also:
- Constant Field Values
-
REQUEST_HANDLER_NAME
protected static final String REQUEST_HANDLER_NAME
- See Also:
- Constant Field Values
-
UPLOAD_TYPE_NORMAL
public static final String UPLOAD_TYPE_NORMAL
- See Also:
- Constant Field Values
-
UPLOAD_TYPE_CHUNKED
public static final String UPLOAD_TYPE_CHUNKED
- See Also:
- Constant Field Values
-
KEY
public static final String KEY
- See Also:
- Constant Field Values
-
NAME
public static final String NAME
- See Also:
- Constant Field Values
-
MIMETYPE
public static final String MIMETYPE
- See Also:
- Constant Field Values
-
FILE_SIZE
public static final String FILE_SIZE
- See Also:
- Constant Field Values
-
MD5
public static final String MD5
- See Also:
- Constant Field Values
-
request
@Context protected javax.servlet.http.HttpServletRequest request
-
response
@Context protected javax.servlet.http.HttpServletResponse response
-
-
Method Detail
-
handlers
public javax.ws.rs.core.Response handlers() throws IOException- Throws:
IOException
-
getHandlerInfo
public javax.ws.rs.core.Response getHandlerInfo(String handlerName) throws IOException
- Throws:
IOException
-
createNewBatch
public javax.ws.rs.core.Response createNewBatch(String handlerName) throws IOException
- Throws:
IOException
-
initBatch
public javax.ws.rs.core.Response initBatch() throws IOException- Throws:
IOException
-
upload
public javax.ws.rs.core.Response upload(@Context javax.servlet.http.HttpServletRequest request, String batchId, String fileIdx) throws IOException- Throws:
IOException
-
uploadNoTransaction
protected javax.ws.rs.core.Response uploadNoTransaction(@Context javax.servlet.http.HttpServletRequest request, String batchId, String fileIdx) throws IOException- Throws:
IOException
-
getUploadedSize
protected long getUploadedSize(javax.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
public javax.ws.rs.core.Response getBatchInfo(String batchId) throws IOException
- Throws:
IOException
-
getFileInfo
public javax.ws.rs.core.Response getFileInfo(String batchId, String fileIdx) throws IOException
- Throws:
IOException
-
cancel
public javax.ws.rs.core.Response cancel(String batchId)
-
execute
public Object execute(String batchId, String operationId, ExecutionRequest xreq)
-
execute
public Object execute(String batchId, String fileIdx, String operationId, ExecutionRequest xreq)
-
getBatchExtraInfo
public javax.ws.rs.core.Response getBatchExtraInfo(String batchId) throws IOException
- Throws:
IOException
-
refreshToken
public javax.ws.rs.core.Response refreshToken(String batchId) throws IOException
- Throws:
IOException- Since:
- 11.1
-
complete
public javax.ws.rs.core.Response complete(String batchId, String fileIdx, String body) throws IOException
- Throws:
IOException
-
completeNoTransaction
protected javax.ws.rs.core.Response completeNoTransaction(String batchId, String fileIdx, String body) throws IOException
- Throws:
IOException
-
executeBatch
protected Object executeBatch(String batchId, String fileIdx, String operationId, javax.servlet.http.HttpServletRequest request, ExecutionRequest xreq)
-
buildResponse
protected javax.ws.rs.core.Response buildResponse(javax.ws.rs.core.Response.StatusType status, Object object) throws IOException- Throws:
IOException
-
buildResponse
@Deprecated(since="11.2") protected javax.ws.rs.core.Response buildResponse(javax.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 javax.ws.rs.core.Response buildJSONResponse(javax.ws.rs.core.Response.StatusType status, String message) throws UnsupportedEncodingException
Deprecated.since 11.2, not used anymore- Throws:
UnsupportedEncodingException
-
buildHTMLResponse
@Deprecated(since="11.2") protected javax.ws.rs.core.Response buildHTMLResponse(javax.ws.rs.core.Response.StatusType status, String message) throws UnsupportedEncodingException
Deprecated.since 11.2, not used anymore- Throws:
UnsupportedEncodingException
-
buildTextResponse
protected javax.ws.rs.core.Response buildTextResponse(javax.ws.rs.core.Response.StatusType status, String message) throws UnsupportedEncodingException- Throws:
UnsupportedEncodingException
-
buildEmptyResponse
protected javax.ws.rs.core.Response buildEmptyResponse(javax.ws.rs.core.Response.StatusType status)
-
buildResponse
protected javax.ws.rs.core.Response buildResponse(javax.ws.rs.core.Response.StatusType status, String type, String message) throws UnsupportedEncodingException- Throws:
UnsupportedEncodingException
-
getFileInfo
protected Map<String,Object> getFileInfo(BatchFileEntry fileEntry)
-
-