Owncloud 8.2.1
Hi, I'm using Java to create directories (collections) and put/delete files over WebDAV.
I programmaticaly create a directory TEST, and tried to rename it
- in the web interface of ownCloud: OK I can rename
- with my java code: I get a 403 Forbidden HTTP response.
My code looks like
sourcePath = "TEST";
destinationPath = "TEST2";
HttpUrl url = new HttpUrl("http://...../remote.php/webdav/" + sourcePath);
url.setUserInfos(... user and password...)
WebdavResource( wdr = new WebdavResource(url);
try {
if (!wdr.exists()) throw new Exception("... doesn't exists");
if (!wdr.moveMethod(destinationPath)) {
throw new Exception(wdr.getStatusCode() + " " + wdr.getStatusMessage());
}
} finally {
wdr.close();
}
I get the 403 Forbidden exception because the moveMethod call doesn't rename (I can confirm by looking in the web interface).
What am I doing wrong ?