mirror of https://github.com/apache/lucene.git
- 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:
parent
64adb57449
commit
1ec9086829
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue