Package io.milton.http.http11
Class PutHelper
java.lang.Object
io.milton.http.http11.PutHelper
A collection of utility methods for PutHandler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyPartialUpdate(GetableResource replacee, Request request, Range range, OutputStream tempOut) Copy the current content of the resource to the outputstream, except writing the new partial update for the given range.findContentTypes(Request request, String newName) returns a textual representation of the list of content types for the new resource.findNearestParent(HttpManager manager, String host, Path path) getContentLength(Request request) parseContentRange(Resource r, Request request) Largly copied from tomcat See the spec http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
-
Constructor Details
-
PutHelper
public PutHelper()
-
-
Method Details
-
parseContentRange
Largly copied from tomcat See the spec http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html- Parameters:
r-request-- Returns:
- Throws:
IOExceptionBadRequestException- - if the range header is invalid
-
getContentLength
- Throws:
BadRequestException
-
findContentTypes
returns a textual representation of the list of content types for the new resource. This will be the content type header if there is one, otherwise it will be determined by the file name- Parameters:
request-newName-- Returns:
-
findNearestParent
public CollectionResource findNearestParent(HttpManager manager, String host, Path path) throws NotAuthorizedException, ConflictException, BadRequestException -
applyPartialUpdate
public void applyPartialUpdate(GetableResource replacee, Request request, Range range, OutputStream tempOut) throws NotAuthorizedException, BadRequestException, NotFoundException Copy the current content of the resource to the outputstream, except writing the new partial update for the given range.- Parameters:
replacee- - the resource to get the content for and to updaterequest-range-tempOut-- Throws:
NotAuthorizedExceptionBadRequestExceptionNotFoundException
-