Hi,
I want to develop thanks to HttpClient a WebDAV access to a remote IIS
server.
I want to retrieve and store data (files) on it.
------------------------------------------------------------------
I have ever started with this code :
DefaultHttpClient httpclient = new DefaultHttpClient();
httpclient.getCredentialsProvider().setCredentials(new
AuthScope("localhost", 80), new UsernamePasswordCredentials("admin",
"admin"));
HttpGet httpget = new HttpGet("
http://computer_name/webdav_access/Docs/ex.xls");
HttpResponse response = httpclient.execute(httpget);
HttpEntity entity = response.getEntity();
if (entity != null) {
FileOutputStream destFile = new
FileOutputStream("c:\\temp\\conf_250206.pdf");
byte buffer[]=new byte[4096];
int nbLecture;
InputStream in = entity.getContent();
while( (nbLecture = in.read(buffer)) != -1 ) {
destFile.write(buffer, 0, nbLecture);
}
destFile.close();
}
if (entity != null) {
entity.consumeContent();
}
------------------------------------------------------------------
Are there more effective code to perform it ?
Thanks in advance,
Regards.
Yannick