updated test cases for spring 2006 schema, and major debug of locking system
[vamsas.git] / src / org / vamsas / client / simpleclient / Lock.java
index 9dd472f..d3a5889 100644 (file)
@@ -6,7 +6,11 @@ import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
 import java.io.IOException;
+import java.io.OutputStream;
 import java.io.RandomAccessFile;
+import java.nio.channels.ByteChannel;
+import java.nio.channels.FileChannel;
+import java.nio.channels.ReadableByteChannel;
 
 import org.apache.commons.logging.LogFactory;
 
@@ -82,4 +86,11 @@ public abstract class Lock {
       return new BufferedInputStream(fis);
     return null;
   }
+  /**
+   * safe lock target length() function.
+   * @return -1 for non-lockable target, otherwise target's file length 
+   */
+  public abstract long length();
+  public abstract RandomAccessFile getRaFile() throws IOException;
+  public abstract FileChannel getRaChannel() throws IOException;
 }