possible OutOfMemoryError
Status: Beta
Brought to you by:
jasonharrop
Hi,
there seems to be a bug in org.apache.commons.vfs.provider.webdav.WebdavFileObject.existsTest. If you do something like this:
FileObject file = VFS.getManager().resolveFile(url);
if (file.exists() && file.getType() == FileType.FOLDER) {
...
}
you may get an OutOfMemoryError because the code leeds to an PROPFIND call with depth invinity. If you got a lot of content behind the url/folder an OutOfMemoryError will occur.
I think you just need to change the first line in the existsTest method from
-> final PropFindMethod propFindMethod = new PropFindMethod(pathEncoded);
to
-> final PropFindMethod propFindMethod = new PropFindMethod(pathEncoded, DepthSupport.DEPTH_0);
best regards
Achim Heiland