commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Westerman <dlwes...@us.ibm.com>
Subject Re: commons-io : FileFilters
Date Thu, 29 Oct 2009 15:01:38 GMT
DUH! I totally missed that, thanks for pointing that out.

So, with the following:

File configCellsDir = new File( FilenameUtils.concat( wasProfile , 
"config/cells" ) ) ;
String[] cellNames = configCellsDir.list( DirectoryFileFilter.INSTANCE ) ;

I can get all the subdirectories directly under the 'cells' directory.

But I take it there is no way to find subdirectories recursively? The 
'dmgr' subdir is several levels deep, and trying this doesn't work:

WildcardFileFilter dmgrFilter = new WildcardFileFilter( "*dmgr*" ) ;
String[] dmgrDirs = configCellsDir.list( dmgrFilter ) ;

Is there any way to do this, without having to write my own 
DirectoryWalker implementation?

Thanks again!
DLW


Jukka Zitting <jukka.zitting@gmail.com> wrote on 10/29/2009 10:39:27 AM:

> [image removed] 
> 
> Re: commons-io : FileFilters
> 
> Jukka Zitting 
> 
> to:
> 
> Commons Users List
> 
> 10/29/2009 10:40 AM
> 
> Please respond to "Commons Users List"
> 
> Hi,
> 
> On Thu, Oct 29, 2009 at 3:15 PM, Dave Westerman <dlwester@us.ibm.com> 
wrote:
> > I'm trying to use Apache Commons IO FileFilters, and it's obvious I 
don't
> > clearly understand them, because I can't get them to work trying to 
find a
> > subdirectory.
> > [...]
> > Can anyone tell me what I'm doing wrong?
> 
> The findFiles() method will only return files, not directories.
> 
> BR,
> 
> Jukka Zitting
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
> 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message