Hello,
Simple method to read all files in direcory with subdirectories can be
implemented in this way:
public void readDirectory( String directoryPath ) throws Exception {
addDirectory( new File( directoryPath ) );
}
private void addDirectory( File file ) throws Exception {
if( file.isDirectory() ) {
for( File f : file.listFiles() ) {
addDirectory( f );
}
}
else {
addFile( file );
}
}
You have to implement addFile( File file ); method.
Best Regards
Piotr Pejas

Signature
Piotr Pejas
Java devleloper
Yumasoft sp. z o. o
www.yumasoft.pl
tel. +4871 78 44 123
nospam@invalid.invalid napisal(a):
> I'm trying to think of a way to select random unknown files from a known
> root folder. The files are randomly in sub-folders and sub-sub folders, etc
[quoted text clipped - 3 lines]
>
> TIA
nospam@invalid.invalid - 01 Dec 2006 12:47 GMT