}
*/
-
/**
- * gets a locked Reader for the vamsas document.
- * @return reader for vamsasdocument.xml enrty
+ * public interface for getting a lock.
+ * The lock object is internally referenced
+ * so the lock will persist even after the
+ * return value of the method goes out of scope.
+ * @return null if lock couldn't be got or a valid Lock object.
*/
public Lock getLock() {
- lockFile();
- return fileLock;
+ if (lockFile())
+ return fileLock;
+ return null;
}
+ /**
+ * explicitly unlocks vamsas file.
+ * if you have called getLock() you *must*
+ * call this to release the lock.
+ */
public void unLock() {
this.unlockFile();
}
- public java.io.Reader getDocumentReader() {
-
- try {
- JarFile session = new JarFile("vamsasJar");
- //JarEntry vamsasDocument = session.getJarEntry("vamsasDocument.xml");
- //return new InputStreamReader(session.getInputStream(vamsasDocument));
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return null;
- }
-
}