uk.ac.vamsas.client.simpleclient
Class VamsasFile

java.lang.Object
  extended byuk.ac.vamsas.client.simpleclient.SessionFile
      extended byuk.ac.vamsas.client.simpleclient.VamsasFile

public class VamsasFile
extends SessionFile

low level vamsas document management routines analogous to ClientsFile Grew out of io tests on VamsasArchive class in uk.ac.vamsas.test.simpleclient.VamsasArchive This class is not thread safe.

Author:
jimp

Field Summary
 
Fields inherited from class uk.ac.vamsas.client.simpleclient.SessionFile
fileLock, sessionFile
 
Constructor Summary
VamsasFile(java.io.File sessionFile)
          Connect to an existing Vamsas document in a given sessionDir or create a new one.
 
Method Summary
 Lock getLock()
          public interface for getting a lock.
 Lock getLock(Lock extantLock)
           
 java.io.File getVamsasFile()
           
 void unLock()
          explicitly unlocks vamsas file.
 
Methods inherited from class uk.ac.vamsas.client.simpleclient.SessionFile
backupSessionFile, backupSessionFile, eraseExistence, getBufferedInputStream, getBufferedOutputStream, getFileInputStream, getFileOutputStream, lockFile, lockFile, unlockFile, updateFrom
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VamsasFile

public VamsasFile(java.io.File sessionFile)
           throws java.io.IOException
Connect to an existing Vamsas document in a given sessionDir or create a new one.

Throws:
java.io.IOException
Method Detail

getVamsasFile

public java.io.File getVamsasFile()
Returns:
the VamsasFile

getLock

public Lock getLock()
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.

Returns:
null if lock couldn't be got or a valid Lock object.

getLock

public Lock getLock(Lock extantLock)
Parameters:
extantLock -
Returns:
null, extantLock or new Lock.

unLock

public void unLock()
explicitly unlocks vamsas file. if you have called getLock() you *must* call this to release the lock.