test for property type and property type constants
[vamsas.git] / src / uk / ac / vamsas / client / simpleclient / SessionFile.java
index 2d213b2..e2d1db7 100644 (file)
@@ -110,7 +110,7 @@ public class SessionFile {
    * @return Backed up SessionFile or null if failed to make backup.
    */
   protected File backupSessionFile() {
-    return backupSessionFile(null, sessionFile.getName(),".old", sessionFile.getParentFile());
+    return backupSessionFile(fileLock, sessionFile.getName(),".old", sessionFile.getParentFile());
   }
 
   protected File backupSessionFile(Lock extantLock, String backupPrefix, String backupSuffix, File backupDir) {
@@ -125,9 +125,9 @@ public class SessionFile {
               fileLock.length());
           tos.close();
           if (!channel.isOpen())
-            throw new Error(tos.getChannel().getClass()+".transferFrom closes source channel!");
+            throw new Error("LIBRARY PORTABILITY ISSUE: "+tos.getChannel().getClass()+".transferFrom closes source channel!");
           if (!lockFile(extantLock))
-            throw new Error("Lost lock for "+sessionFile.getName()+" after backup.");
+            throw new Error("LIBRARY PORTABILITY ISSUE: Lost lock for "+sessionFile.getName()+" after backup.");
           
         }
       } catch (FileNotFoundException e1) {
@@ -165,9 +165,13 @@ public class SessionFile {
       lockFile();
       trafile = fileLock.getRaFile();
     }*/
+    // TODO JBPNote: attempt to ensure save really saves the VamDoc.jar file
     trafile.seek(0);
     trafile.getChannel().transferFrom(nrafile.getChannel(), 0, 
         nrafile.length());
+    // JBPNote: attempt to close the streams to flush the data out
+    // trafile.close();
+    //nrafile.close();
   }
   /**
    * remove all trace of the sessionFile file