jakarta-oro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan Lipofsky <dlipof...@kurion.com>
Subject RE: GlobFilenameFilter problem
Date Wed, 21 Feb 2001 21:32:24 GMT
Please ignore this bug report.  It turns out that java was expanding
*.html to package.html (because it exists in the current working directory).
Since package.html did not exists in x nothing got printed.

I used the quotes to turn off shell globbing.
I never knew that Java did globbing too.  This
is so obnoxious.  Does anyone know if there is
a way to turn off java globbing (JDK 1.3, Win 2000).

Also, if Sun went through the effort of implementing
globbing for processing the command line, why didn't
they go ahead and make it part of the API????
- Dan

> -----Original Message-----
> From: Dan Lipofsky [mailto:dlipofsky@kurion.com]
> Sent: Wednesday, February 21, 2001 12:54 PM
> To: 'oro-user@jakarta.apache.org'
> Subject: 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'
> $

Mime
View raw message