The code below yields the following exception: org.apache.commons.httpclient.HttpMethodBase processRedirectResponse INFO: Redirect requested but followRedirects is disabled The problem is several-fold: 1. the failure seems to be associated with the fact that the collection name does not end in '/' - i.e. instead of asking if '/a/b/c/' is a collection, the code asks if '/a/b/c' 2. the "getPath" returns value without the terminating '/' for the collection 3. the code accesses the DAV server to query for the state (collection or "simple") whereas this could have been inferred from the initial response to the "listFiles" request and cached (along with the correct path name) try { final HttpURL u=new HttpURL("somehost", somePort, "someCollectionPath"); final WebdavFile wf=new WebdavFile(u); final File[] fl=wf.listFiles(); final int numFiles=(null == fl) ? 0 : fl.length; for (int fIndex=0; fIndex < numFiles; fIndex++) { final File f=fl[fIndex]; if (null == f) // should not happen continue; final boolean isFolder=f.isDirectory(); System.out.println("\t" + f.getPath() + "(" + isFolder + ")"); } } catch(URIException ue) { System.err.println("URI exception: " + ue.getMessage()); return (-1); }
Elijah, I think that this is solved in the source code already. If you can checkout from SVN the current Slide codebase and compile it, you will get a Slide client without this bug.