How can I use PropFindMethod?
Tanakorn Leesatapornwongsa <[email protected]> Mon, 4 May 2009 11:28:15 +0700
| Newsgroups | gmane.comp.jakarta.slide.user |
|---|---|
| Message-ID | <[email protected]> |
--0016e64714f2510e0804690e97c8
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
I want to use PropFindMethod to retrieves my interesting properties of the
file. When I used this, it didn't send XML properties name that I want to
the server.
My code like this,
HttpClient http = new HttpClient();
> Credentials credentials = new
> UsernamePasswordCredentials(SERVER_USERNAME, SERVER_PASSWORD);
> http.getState().setCredentials(new
> AuthScope(SERVER_HOST,SERVER_PORT), credentials);
> http.getParams().setAuthenticationPreemptive(true);
> HostConfiguration hostConfig = new HostConfiguration();
> hostConfig.setHost(SERVER_HOST, SERVER_PORT, SERVER_PROTOCAL);
> PropFindMethod propFindMethod = new PropFindMethod();
> propFindMethod.setDepth(DepthSupport.DEPTH_0);
> propFindMethod.setPath(CALDAV_SERVER_WEBDAV_ROOT);
> propFindMethod.setType(PropFindMethod.BY_NAME);
> Vector<PropertyName> v = new Vector<PropertyName>();
> v.add(new PropertyName("DAV", "resourcetype"));
> v.add(new PropertyName("DAV", "calendar-home-set"));
> propFindMethod.setPropertyNames(v.elements());
> status = http.executeMethod(hostConfig, propFindMethod);
> System.out.println(status);
>
But I found that my code didn't send properties "resourcetype" and
"calendar-home-set" to the server it only sent the header?
Is my code wrong?
Thank you.
--0016e64714f2510e0804690e97c8--