sunlabs.brazil.sunlabs
Class PutHandler
public
class
PutHandler
extends Object
implements Handler
Simple PUT and DELETE method handler.
Create, update, or delete files implied by the URL.
returns:
(for PUT)
- 201 Created
- 204 No Content - it worked
- 415 Invalid file suffix (no mime type found)
- 403 bad file permissions
- 409 conflict suffix does not match mime type
- 500 server error: can't complete file write
- 501 invalid content-range
(for DELETE)
- 204 No Content - delete succeeded
- 403 forbidden - no delete permissions
- 404 not found - no file to delete
To be uploaded, the file suffix must match the content type
defined on the server and the content type of the request.
- root
- The document root. Can be used to override the default document root.
- prefix, suffix, glob, match
- Specifies which URL's trigger this handler. (See MatchString).
TODO:
- allow the deletion of empty directories
- support byte-ranges for updating
NOTES:
This handler mostly overlaps the functionallity of the
PublishHandler, and they should be combined.
public boolean init(
Server server, String prefix)
public boolean respond(
Request request)