You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oro-user@jakarta.apache.org by Dan Lipofsky <dl...@kurion.com> on 2001/02/21 19:54:01 UTC

GlobFilenameFilter problem

I am encountering a problem with GlobFilenameFilter.
It correctly catches files for the pattern 'i*.html'
but not the more general '*.html'.  I am using version 2.0.
Here is proof:

  public static void main(String args[]) {
    File srcDir = new File(args[0]);
    FilenameFilter filter =
      (args.length>1)
      ? (new org.apache.oro.io.GlobFilenameFilter(args[1]))
      : null;
    File[] files = srcDir.listFiles(filter);
    for (int i=0; i<files.length; i++) {
      System.out.println((files[i].isDirectory() ? "DIR " : "file")+"
"+files[i]);
    }
  }

$ java Test x
file  x\allclasses-frame.html
DIR   x\com
file  x\deprecated-list.html
file  x\help-doc.html
file  x\index-all.html
file  x\index.html
file  x\overview-tree.html
file  x\package-list
file  x\packages.html
file  x\serialized-form.html
file  x\stylesheet.css
$ java Test x 'i*.html'
file  x\index-all.html
file  x\index.html
$ java Test x '*.html'
$

Thanks,
Dan