Log.log( Log.CRITICAL, MODULE, "assertion failed: listFilesRecursive called on a non-dir file" );
Log.log( Log.LEVEL_CRITICAL, MODULE, "assertion failed: listFilesRecursive called on a non-dir file" );
	static List listFilesRecursive( File dir )		throws IOException {		ArrayList ret = new ArrayList();		/* File.listFiles: stupid call returns null if there's an				   i/o exception *or* if the file is not a directory, making a mess.				   http://java.sun.com/j2se/1.4/docs/api/java/io/File.html#listFiles() */		File[] fileArray = dir.listFiles();		if ( fileArray == null ) {			if ( dir.isDirectory() ) {				/* convert to exception */				throw new IOException( "i/o exception listing directory: " + dir.getPath() );			} else {				/* this method should only be called on a directory */				Log.log( Log.CRITICAL, MODULE, "assertion failed: listFilesRecursive called on a non-dir file" );				return ret;			}		}		List files = Arrays.asList( fileArray );		Iterator iter = files.iterator();		while ( iter.hasNext() ) {			File f = (File) iter.next();			if ( f.isDirectory() ) {				ret.addAll( listFilesRecursive( f ) );			} else {				ret.add( f );			}		}		return ret;	}