- Added public static boolean isLocked(String) method.

PR:
Obtained from:
Submitted by:	Colin Britton
Reviewed by:	otis


git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@149690 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Otis Gospodnetic 2002-02-15 18:59:42 +00:00
parent 64adb57449
commit 1ec9086829
1 changed files with 10 additions and 0 deletions

View File

@ -310,6 +310,16 @@ abstract public class IndexReader {
return directory.fileExists("write.lock");
}
/**
* Returns <code>true</code> iff the index in the named directory is
* currently locked.
* @param directory 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();
}
/**
* Forcibly unlocks the index in the named directory.
* <P>