[Neo] [Commits] r2718 - components/index-util/trunk/src/main/java/org/neo4j/util/index
Tobias Ivarsson
tobias.ivarsson at neotechnology.com
Sun Apr 5 18:22:38 CEST 2009
On Sun, Apr 5, 2009 at 6:19 PM, Mattias Persson
<mattias at neotechnology.com>wrote:
> 2009/4/5 <johans at lists.neo4j.org>:
> > Author: johans
> > Date: 2009-04-05 17:14:05 +0200 (Sun, 05 Apr 2009)
> > New Revision: 2718
> >
> > Modified:
> >
> components/index-util/trunk/src/main/java/org/neo4j/util/index/LuceneDataSource.java
> > Log:
> > Changed get of lucene directory to use File instead of string path.
> >
> >
> >
> > Modified:
> components/index-util/trunk/src/main/java/org/neo4j/util/index/LuceneDataSource.java
> > ===================================================================
> > ---
> components/index-util/trunk/src/main/java/org/neo4j/util/index/LuceneDataSource.java
> 2009-04-05 12:09:25 UTC (rev 2717)
> > +++
> components/index-util/trunk/src/main/java/org/neo4j/util/index/LuceneDataSource.java
> 2009-04-05 15:14:05 UTC (rev 2718)
> > @@ -231,7 +231,7 @@
> > try
> > {
> > Directory dir = FSDirectory.getDirectory(
> > - storeDir + "/" + key );
> > + new File( storeDir + "/" + key ) );
> > if ( dir.list().length == 0 )
> > {
> > return null;
> > @@ -288,7 +288,8 @@
> > try
> > {
> > getWriteLock( key );
> > - Directory dir = FSDirectory.getDirectory( storeDir + "/" +
> key );
> > + Directory dir = FSDirectory.getDirectory(
> > + new File( storeDir + "/" + key ) );
> > return new IndexWriter( dir, getAnalyzer(),
> > MaxFieldLength.UNLIMITED );
> > }
> >
>
> Shouldn't that be:
>
> new File( storeDir, key ) instead?
> Manually concatenating "/" characters in paths without checkinf if
> they already exists aren't that great.
+1
--
Tobias Ivarsson <tobias.ivarsson at neotechnology.com>
Hacker, Neo Technology
www.neotechnology.com
Cellphone: +46 706 534857
More information about the User
mailing list