lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Otis Gospodnetic <otis_gospodne...@yahoo.com>
Subject Re: Patch for IndexReader
Date Fri, 15 Feb 2002 04:35:49 GMT
This addition looks fine to me - the isLocked(Directory) method already
exists in IndexReader, so this is good for completion.

I will commit this tomorrow morning unless somebody sends me an email
by then with arguments against this patch.

Thanks,
Otis


--- "Britton, Colin" <cbritton@metatomix.com> wrote:
> Here is a patch for IndexReader.isLocked() to support file and string
> in
> the same way as IndexReader.indexExists()
> 
> It is in the body and as an attachment.
> 
> Rgds
> CB
> 
> Index: IndexReader.java
> ===================================================================
> RCS file:
>
/home/cvspublic/jakarta-lucene/src/java/org/apache/lucene/index/IndexRea
> der.java,v
> retrieving revision 1.6
> diff -u -r1.6 IndexReader.java
> --- IndexReader.java	21 Jan 2002 17:07:23 -0000	1.6
> +++ IndexReader.java	8 Feb 2002 18:40:03 -0000
> @@ -269,7 +269,28 @@
>     */
>      abstract public void close() throws IOException;
>  
> -  /**
> + /**
> +   * Returns <code>true</code> iff the index in the named directory
> is
> +   * currently locked.
> +   * @param String the directory to check for a lock
> +   * @throws IOException if there is a problem with accessing the
> index
> +   */
> +   public static boolean isLocked(String directory) throws
> IOException
> {
> +    return (new File(directory, "write.lock")).exists();
> +  }
> +  
> + /**
> +   * Returns <code>true</code> iff the index in the named directory
> is
> +   * currently locked.
> +   * @param File the directory to check for a lock
> +   * @throws IOException if there is a problem with accessing the
> index
> +   */  
> +  public static boolean isLocked(File directory) throws IOException
> {
> +    return (new File(directory, "write.lock")).exists();
> +  }
> +
> +
> + /**
>     * Returns <code>true</code> iff the index in the named directory
> is
>     * currently locked.
>     * @param directory the directory to check for a lock
> 
> *****CVS exited normally with code 1*****
> 

> ATTACHMENT part 2 application/octet-stream name=lucene_patch.diff
> --
> To unsubscribe, e-mail:  
> <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:lucene-dev-help@jakarta.apache.org>


__________________________________________________
Do You Yahoo!?
Got something to say? Say it better with Yahoo! Video Mail 
http://mail.yahoo.com

--
To unsubscribe, e-mail:   <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-dev-help@jakarta.apache.org>


Mime
View raw message