2009-02-06 01:02:33 UTC
Hello!
I am not sure this is the place to ask, but I'll try.
Can someone provide a sample code to get .eml files from Inbox folder of MS Exchange server. Only OWA via https is enabled.
My code is like one above:
HttpURL url = new HttpsURL("
https://mail.somecompany.com");
url.setUserinfo("testuser", "userpassword");
url.setPath("/exchange/
mailboxname@somecompany.com/Inbox/");
WebdavResource wdr = new WebdavResource(url);
String[] list = wdr.list();
for (int m = 0; m < list.length; m++)
{
System.out.println(list[m]); // that works - prints .eml files
File localDestination = new File(list[m]);
tt.getMethod(localDestination);
}
This code downloads files as html. In fact even worse - root folder of OWA inbox, so if I must "?Cmd=open" at the end of url to get specific .eml-file (but again formated as html).
My paths are ok, if I add a new network place in Windows it is possible to view and get eml files. But how to do this in java?
10x in advance, any help will be useful.