Hi Ben,

[...]
 
> 2. Initially clients with write-access only need a few simple 
> operations,
> limited to individual files: add (POST), replace (PUT), 
> delete (DELETE)

IMO, the PUT should be mapped to both "replace" and "create", unless you
want the server to control the URI of the created resources (via a POST to a
list resource, followed by a PUT to the target resource).

[...]

> SVNRestlet:
> - extends Finder; all it does is some custom initialization:
>  - super(context, SVNResource.class)
>  - uses the SVNKit library to create an SVNRepository for the 
> specified SVN
> repo, and adds a reference to this into the Context, so that 
> SVNResource
> instances can get a handle to the repo (is using the 
> Context's attributes map in
> this way recommended?)

Yes, this is fine.

> SVNResource:
> - extends Resource
> - initialization: creates a single Representation and adds it 
> to the Variants
> - createMainRepresentation: the bulk of the work
>  - extracts the intended SVN path from the request:
>    request.getResourceRef().getRelativeRef().getRelativePart();
>  - extracts the intended SVN version from the request's query portion
>    (-1, empty, or unparseable is interpreted as HEAD version)
>  - checks what's in the repo at said path and revision
>   - sets response status code if error, and return a null 
> Representation
>   - or, if such a file exists
>    - tries to determine MediaType from an SVN mime-type property
>    - if not present, uses */* MediaType

Maybe "application/octet-stream" would be better here?

[...]

> How am I doing so far?

Looks good to me! :-)

> How should I proceed to allow PUT, DELETE, POST? 
> Override put(), etc. in my SVNResource class?

If you are using Restlet trunk (future 1.1), you should override the new
methods:
 - acceptRepresentation(Representation entity) for POST
 - setModifiable(boolean modifiable) for PUT
 - removeRepresentations() for DELETE
 - set/isModifiable() to indicate if POST/PUT/DELETE are allowed
 
> =============
> WEBDAV
> =============
> 
> I did get a hold of an old Slide Webclient .jar and some 
> documentation. Looking
> through the javadoc, however, it doesn't feel like a good 
> match. It's worth
> spending some more time on, though.

Let us know how it goes. If someone has time/interest, it seems like a
Restlet-based WebDAV client would be a useful project for the Java
community.

Best regards,
Jerome  

Reply via email to