[Building Sakai] custom entity broker for http delete

Stephen Marquard stephen.marquard at uct.ac.za
Mon Jul 30 10:56:56 PDT 2012


You should be able to use the DELETE method with the webdav path to the
resource.


Here's a quick test on nightly2 to delete a file called slowlist.txt I
uploaded to the citationsAdmin site:


$ curl -v -X DELETE -u "admin:admin"
http://nightly2.sakaiproject.org:8082/dav/group/citationsAdmin/slowlist.txt?__auth=basic


* About to connect() to nightly2.sakaiproject.org port 8082 (#0)
*   Trying 134.68.26.90... connected
* Connected to nightly2.sakaiproject.org (134.68.26.90) port 8082 (#0)
* Server auth using Basic with user 'admin'
> DELETE /dav/group/citationsAdmin/slowlist.txt?__auth=basic HTTP/1.1
> Authorization: Basic YWRtaW46YWRtaW4=
> User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4
OpenSSL/0.9.8r zlib/1.2.5
> Host: nightly2.sakaiproject.org:8082
> Accept: */*
> 
< HTTP/1.1 200 OK
< Server: Apache-Coyote/1.1
< Cache-Control: private
< Expires: Wed, 31 Dec 1969 19:00:00 EST
< X-UA-Compatible: IE=EmulateIE9
< Content-Length: 0
< Date: Mon, 30 Jul 2012 17:55:46 GMT
< 
* Connection #0 to host nightly2.sakaiproject.org left intact
* Closing connection #0



Regards
Stephen

Stephen Marquard, Learning Technologies Co-ordinator 
Centre for Educational Technology, University of Cape Town
http://www.cet.uct.ac.za
Email/IM/XMPP: stephen.marquard at uct.ac.za 
Phone: +27-21-650-5037 Cell: +27-83-500-5290
>>> Marc Savitsky  07/30/12 5:31 PM >>>
I need to write a custom entitybroker method to remove a resource.

I have tried to use http delete, for example

curl -v -X DELETE -u "admin:admin" 
http://localhost:8080/direct/content/group/9c57a615-c92a-4879-baaf-3ec8df262b16/myFolder/myfile.txt/removefile?__auth=basic

but entity provider doesn't like the slashes in resource id and 
entityExists is called with a truncated string.

Does anybody know if it is possible to use a http delete in the case 
where the resource id contains slash characters?
Or can anybody suggest another way that I should be looking at to do
this?
_______________________________________________
sakai-dev mailing list
sakai-dev at collab.sakaiproject.org
http://collab.sakaiproject.org/mailman/listinfo/sakai-dev

TO UNSUBSCRIBE: send email to
sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of
"unsubscribe"






###

UNIVERSITY OF CAPE TOWN 

This e-mail is subject to the UCT ICT policies and e-mail disclaimer
published on our website at
http://www.uct.ac.za/about/policies/emaildisclaimer/ or obtainable from
+27 21 650 9111. This e-mail is intended only for the person(s) to whom
it is addressed. If the e-mail has reached you in error, please notify
the author. If you are not the intended recipient of the e-mail you may
not use, disclose, copy, redirect or print the content. If this e-mail
is not related to the business of UCT it is sent by the sender in the
sender's individual capacity.

###
 



More information about the sakai-dev mailing list