TheProjecter / sardine

Automatically exported from code.google.com/p/sardine
0 stars 0 forks source link

Get DavResource for resource on sharepoint #105

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Using sardine.list() for a sharepoint directory gets a list with DavResources. 
But using sardine.list() for a single resource gives:

com.googlecode.sardine.impl.SardineException: Unexpected response
    at com.googlecode.sardine.impl.handler.ValidatingResponseHandler.validateResponse(ValidatingResponseHandler.java:49)
    at com.googlecode.sardine.impl.handler.VoidResponseHandler.handleResponse(VoidResponseHandler.java:35)
    at com.googlecode.sardine.impl.SardineImpl.get(SardineImpl.java:481)
    at com.googlecode.sardine.impl.SardineImpl.get(SardineImpl.java:461)

Using other webdav server such as jackrabbit I can confirm that I can get a 
DavResource using list() for a single resource.

I'm using the latest svn revision.

Original issue reported on code.google.com by pedro.a3...@gmail.com on 2 Aug 2011 at 4:22

GoogleCodeExporter commented 9 years ago
Updating to the latest snapshot will print the HTTP error message returned by 
the server.

Original comment by dkocher@sudo.ch on 8 Aug 2011 at 7:59

GoogleCodeExporter commented 9 years ago
Well the reason that sharepoint gives is that the resource can't be found, 
although it's there...

I have noticed that you are using java URI class. What's the proper way to 
encode the uri string so that URI allows things like 
"http://localhost:80/dummy/hello dude.txt", i.e. with special characters?

Original comment by pedro.a3...@gmail.com on 8 Aug 2011 at 8:15

GoogleCodeExporter commented 9 years ago
You have to encode the path using  URI percented encoding. Note that this 
differs from application/x-www-form-urlencoded. A space must be encoded with 
%20.

Original comment by dkocher@sudo.ch on 8 Aug 2011 at 9:44