This is the first time I use VFS. But local and http file access works. But using webdav (with *Alfresco* as server) does not work. The Problem is similar to this one: http://mail-archives.apache.org/mod_mbox/commons-user/201109.mbox/%[email protected]%3E
*I am doing the following:* private static final String URL = "webdav:// admin:[email protected]:8080/alfresco/webdav/firmware/"; DefaultFileSystemManager manager = new DefaultFileSystemManager(); manager.addProvider("file", new DefaultLocalFileProvider()); manager.addProvider("http", new HttpFileProvider()); manager.addProvider("webdav", new WebdavFileProvider()); manager.setCacheStrategy(CacheStrategy.ON_RESOLVE); manager.setFilesCache(new SoftRefFilesCache()); manager.init(); final FileObject fileObject = manager.resolveFile(URL) System.out.println("Name:" + fileObject.getName()); System.out.println("Attached:" + fileObject.isAttached()); try { fileObject.isReadable(); } catch (Exception e) { System.out.println("Message: " + e.getMessage() + "\nCause: " + e.getCause()+ "\nStacktrace: " + getStackTrace(e)); } try { fileObject.getChildren(); } catch (Exception e) { System.out.println("Message: " + e.getMessage() + "\nCause: " + e.getCause()+ "\nStacktrace: " + getStackTrace(e)); } try { fileObject.isFolder(); } catch (Exception e) { System.out.println("Message: " + e.getMessage() + "\nCause: " + e.getCause()+ "\nStacktrace: " + getStackTrace(e)); } *Result:* Name:webdav://admin:[email protected]:8080/alfresco/webdav/firmware/ *Attached:false* Message: Could not determine if file "webdav://admin:***@ 192.168.66.124:8080/alfresco/webdav/firmware/" is readable. Cause: org.apache.commons.vfs2.FileSystemException: Could not determine the type of file "webdav://admin:***@ 192.168.66.124:8080/alfresco/webdav/firmware/". Stacktrace: org.apache.commons.vfs2.FileSystemException: Could not determine if file "webdav://admin:***@ 192.168.66.124:8080/alfresco/webdav/firmware/" is readable. … Caused by: java.lang.ClassCastException: java.util.ArrayList cannot be cast to org.w3c.dom.Node at org.apache.commons.vfs2.provider.webdav.WebdavFileObject.isDirectory(WebdavFileObject.java:718) at org.apache.commons.vfs2.provider.webdav.WebdavFileObject.doGetType(WebdavFileObject.java:405) at org.apache.commons.vfs2.provider.AbstractFileObject.getType(AbstractFileObject.java:1497) ... 57 more Message: Could not list the contents of folder "webdav://admin:***@ 192.168.66.124:8080/alfresco/webdav/firmware/". Cause: java.lang.ClassCastException: java.util.ArrayList cannot be cast to org.w3c.dom.Node Stacktrace: org.apache.commons.vfs2.FileSystemException: Could not list the contents of folder "webdav://admin:***@ 192.168.66.124:8080/alfresco/webdav/firmware/". … Caused by: java.lang.ClassCastException: java.util.ArrayList cannot be cast to org.w3c.dom.Node at org.apache.commons.vfs2.provider.webdav.WebdavFileObject.isDirectory(WebdavFileObject.java:718) at org.apache.commons.vfs2.provider.webdav.WebdavFileObject.doListChildrenResolved(WebdavFileObject.java:453) at org.apache.commons.vfs2.provider.AbstractFileObject.getChildren(AbstractFileObject.java:1147) ... 55 more Message: Could not determine the type of file "webdav://admin:***@ 192.168.66.124:8080/alfresco/webdav/firmware/". Cause: java.lang.ClassCastException: java.util.ArrayList cannot be cast to org.w3c.dom.Node Stacktrace: org.apache.commons.vfs2.FileSystemException: Could not determine the type of file "webdav://admin:***@ 192.168.66.124:8080/alfresco/webdav/firmware/". … Caused by: java.lang.ClassCastException: java.util.ArrayList cannot be cast to org.w3c.dom.Node at org.apache.commons.vfs2.provider.webdav.WebdavFileObject.isDirectory(WebdavFileObject.java:718) at org.apache.commons.vfs2.provider.webdav.WebdavFileObject.doGetType(WebdavFileObject.java:405) at org.apache.commons.vfs2.provider.AbstractFileObject.getType(AbstractFileObject.java:1497) ... 56 more What am I doing wrong? And what does "Attached:false" means?
