Class SimpleDocumentResourceCreator
- java.lang.Object
-
- org.silverpeas.core.web.rs.RESTWebService
-
- org.silverpeas.core.webapi.attachment.AbstractSimpleDocumentResource
-
- org.silverpeas.core.webapi.attachment.SimpleDocumentResourceCreator
-
- All Implemented Interfaces:
ProtectedWebResource
,WebAuthenticationValidation
,WebAuthorizationValidation
,SilverpeasWebResource
@WebService @Path("documents/{componentId}/document/create") @Authorized public class SimpleDocumentResourceCreator extends AbstractSimpleDocumentResource
- Author:
- ehugonnet
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SimpleDocumentResourceCreator.Context
-
Nested classes/interfaces inherited from class org.silverpeas.core.web.rs.RESTWebService
RESTWebService.WebProcess<R>, RESTWebService.WebTreatment<R>
-
-
Field Summary
-
Fields inherited from class org.silverpeas.core.web.rs.RESTWebService
RESPONSE_HEADER_ARRAYSIZE
-
Fields inherited from interface org.silverpeas.core.web.SilverpeasWebResource
BASE_PATH
-
-
Constructor Summary
Constructors Constructor Description SimpleDocumentResourceCreator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.ws.rs.core.Response
createDocument(String filename)
Create the document identified by the requested URI and from the content and some additional parameters passed within the request.protected SimpleDocumentEntity
createSimpleDocument(SimpleDocumentUploadData uploadData, String filename)
-
Methods inherited from class org.silverpeas.core.webapi.attachment.AbstractSimpleDocumentResource
checkUploadedFile, getBundleLocation, getComponentId, getResourceBasePath, performRuntimeException
-
Methods inherited from class org.silverpeas.core.web.rs.RESTWebService
createWebResourceUri, fromPage, getBundle, getHighestUserRole, getHttpRequest, getHttpServletRequest, getHttpServletResponse, getOrganisationController, getSilverpeasContext, getUri, getUser, getUserPreferences, getUserRoles, identifiedBy, identifiedBy, initContext, initWebResourceUri, isUserDefined, process
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.silverpeas.core.web.rs.ProtectedWebResource
validateUserAuthorization
-
Methods inherited from interface org.silverpeas.core.web.rs.WebAuthenticationValidation
validateUserAuthentication
-
-
-
-
Method Detail
-
createDocument
@POST @Path("{filename}") @Consumes("multipart/form-data") public javax.ws.rs.core.Response createDocument(@PathParam("filename") String filename) throws IOException
Create the document identified by the requested URI and from the content and some additional parameters passed within the request.A
SimpleDocumentUploadData
is extracted from request parameters.- Returns:
- an HTTP response embodied an entity in a format expected by the client (that is
identified by the
xRequestedWith
parameter). - Throws:
IOException
- if an error occurs while updating the document.
-
createSimpleDocument
protected SimpleDocumentEntity createSimpleDocument(SimpleDocumentUploadData uploadData, String filename) throws IOException
- Throws:
IOException
-
-