lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nick Vincent" <>
Subject RE: Index all the files in a directory
Date Thu, 13 Apr 2006 10:07:46 GMT
Hi Kostas,

I am assuming you need to find all of the text files in the directory.
Assuming you're using JDK1.5 you need to do something like this:

File directory = new File("c:\my\directory");
FilenameFilter findTextFiles = new FilenameFilter() {
	public boolean accept(File dir, String name)
		return name.endsWith(".txt");
for( File indexFile : directory.listFiles(findTextFiles) )
{ Lucene indexing

If you are using JDK1.5 you can do the same using normal for loops.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message