Hola,
I hope this isn't a redundant post, I have searched through some of the back archives but I haven't come across an answer.


Essentially this is the bit of code that I'm trying to get to run:

HttpURL rootUrl = new HttpURL(uploadServerURL + "/" + providerFolderName);
rootUrl.setUserinfo(userName, password);
WebdavResource providerDirectory = new WebdavResource(rootUrl);


if (!providerDirectory.exists()) {
log.info("Provider directory: " + providerFolderName + " does not exist, creating.");
providerDirectory.mkcolMethod();
}


However the constructor of the WebdavResource throws an HttpException with status code 404. The 404 bit makes sense because the first time this bit of code runs the directory hasn't been created yet. I have verified this with both the 2.0 and 2.1RC1 versions of the WebDAV client. Constructing the WebdavResource for just the rootUrl works just fine in the above example. Any pointers on what I must be doing wrong would be greatly appreciated. Thanks!

Regards,
        Max

Stack dump from the 2.1RC1:

at org.apache.webdav.lib.WebdavResource.propfindMethod(WebdavResource.java: 3467)
at org.apache.webdav.lib.WebdavResource.propfindMethod(WebdavResource.java: 3423)
at org.apache.webdav.lib.WebdavResource.setNamedProp(WebdavResource.java: 967)
at org.apache.webdav.lib.WebdavResource.setBasicProperties(WebdavResource.j ava:912)
at org.apache.webdav.lib.WebdavResource.setProperties(WebdavResource.java: 1894)
at org.apache.webdav.lib.WebdavResource.setHttpURL(WebdavResource.java: 1301)
at org.apache.webdav.lib.WebdavResource.setHttpURL(WebdavResource.java: 1320)
at org.apache.webdav.lib.WebdavResource.setHttpURL(WebdavResource.java: 1408)
at org.apache.webdav.lib.WebdavResource.<init>(WebdavResource.java:290)

Reply via email to