Package io.milton.http.json
Class PutJsonResource
java.lang.Object
io.milton.http.json.JsonResource
io.milton.http.json.PutJsonResource
- All Implemented Interfaces:
DigestResource,GetableResource,PostableResource,Resource
Will use milton's PUT framework to support file uploads using POST and
multipart encoding
This will save the uploaded files with their given names into the parent collection resource.
If a file already exists with the same name a ConflictException is thrown, unless you set the _autoname request parameter. If this parameter is present (ie with any value) the file will be saved with a non-conflicting file name
Save file information is returned as JSON in the response content
- Author:
- brad
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields inherited from class io.milton.http.json.JsonResource
CONTENT_TYPE -
Constructor Summary
ConstructorsConstructorDescriptionPutJsonResource(PutableResource putableResource, String href, EventManager eventManager) -
Method Summary
Modifier and TypeMethodDescriptiongetContentType(String accepts) voidsendContent(OutputStream out, Range range, Map<String, String> params, String contentType) Returns a JSON representation of the newly created hrefsMethods inherited from class io.milton.http.json.JsonResource
authenticate, authenticate, authorise, checkRedirect, getContentLength, getMaxAgeSeconds, getModifiedDate, getName, getRealm, getUniqueId, getWrappedResource, isDigestAllowedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.milton.resource.GetableResource
getContentLength, getMaxAgeSecondsMethods inherited from interface io.milton.resource.Resource
authenticate, authorise, checkRedirect, getModifiedDate, getName, getRealm, getUniqueId
-
Field Details
-
PARAM_AUTONAME
- See Also:
-
PARAM_NAME
- See Also:
-
PARAM_OVERWRITE
- See Also:
-
-
Constructor Details
-
PutJsonResource
-
-
Method Details
-
getContentType
- Specified by:
getContentTypein interfaceGetableResource- Overrides:
getContentTypein classJsonResource
-
processForm
public String processForm(Map<String, String> parameters, Map<String, throws ConflictException, NotAuthorizedException, BadRequestExceptionFileItem> files) - Specified by:
processFormin interfacePostableResource- Throws:
ConflictExceptionNotAuthorizedExceptionBadRequestException
-
sendContent
public void sendContent(OutputStream out, Range range, Map<String, String> params, String contentType) throws IOException, NotAuthorizedExceptionReturns a JSON representation of the newly created hrefs- Specified by:
sendContentin interfaceGetableResource- Parameters:
out-range-params-contentType-- Throws:
IOExceptionNotAuthorizedException
-
applicableMethod
- Specified by:
applicableMethodin classJsonResource
-