[Neo] [Commits] r2718 - components/index-util/trunk/src/main/java/org/neo4j/util/index
Mattias Persson
mattias at neotechnology.com
Sun Apr 5 18:19:54 CEST 2009
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.
> _______________________________________________
> Commits mailing list
> Commits at lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/commits
>
--
Mattias Persson, [mattias at neotechnology.com]
Neo Technology, www.neotechnology.com
More information about the User
mailing list