commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <fovea1959-apa...@yahoo.com>
Subject VFS/WebDav findFile problem with nested directories?
Date Fri, 14 Oct 2005 19:08:21 GMT
Is this a bug, or am I misusing VFS?

I'm trying to recusively find all the file in a
directory tree. This works fine with a local
directory, but using a WebDav URL, I only get the
first level (lower level directories don't get
returned in the findFiles for the root directory).

I'm using the VFS nightly build 20051014, and
jakarta-slide-webdavclient-bin-2.1, Java 1.4.2_08.

  static void recurse (FileObject dir) throws
FileSystemException {
    System.out.println("All files of " +
dir.getName().getURI());
    FileObject[] children = dir.findFiles(new
AllFileSelector());
    if (children != null)
    for (int i = 0; i < children.length; i++) {
      if (children[i].equals(dir)) continue;
     
System.out.println(children[i].getName().getURI());
      if
(children[i].getType().equals(FileType.FOLDER)) {
        System.out.println ("dipping into " +
dir.getName().getURI());
        recurse (children[i]);
      }
    }
  }

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message