lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <>
Subject Re: Directory.list() deprecation
Date Fri, 06 Nov 2009 09:26:05 GMT
Well... you can use oal.index.IndexFileNameFilter.getFilter() to
filter for only the Lucene index files, or, you could filter for the
additional files you know you've placed in the index directory?

The motivation for this change was that Directory is the wrong place
to have "smarts" about what is & isn't an index file: it's too
low-level (and, different Directory impls were inconsistent).
Especially with flexible indexing coming, where a codec can write
whatever files it wants, the Directory has no way know.

Some details are in


On Fri, Nov 6, 2009 at 12:39 AM, Daniel Noll <> wrote:
> Hi all.
> I am trying to clean up some deprecated calls which are showing up on
> upgrading to 2.9.0 (from 2.3.2...), and I have just come across
> Directory.list(), which says this:
>> Deprecated For some Directory implementations (FSDirectory, and its subclasses),
this method silently filters its results to include only index files. Please use listAll instead,
which does no filtering.
>  * We have files in there which aren't Lucene's so obviously
> listAll() will not work.
>  * We can't use FSDirectory directly because our tests rely on the
> Directory abstraction so that they can use a RAMDirectory.
> Given this, what is the suggested replacement for this method once it goes away?
> I'm not sure I understand the motivation for the change in list(), but
> I do think it was inconsistent for Directory implementations to
> perform different filtering (they should have at least all used the
> same filter.)
> Daniel
> --
> Daniel Noll                            Forensic and eDiscovery Software
> Senior Developer                              The world's most advanced
> Nuix                                                email data
>                                and eDiscovery software
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message