VamsasSession: Fixed VamsasSession init/construction if the session directory exist...
[vamsas.git] / src / uk / ac / vamsas / client / simpleclient / VamsasSession.java
index 5b8875c..1c77d66 100644 (file)
@@ -162,11 +162,13 @@ public class VamsasSession {
     if (sessionDir1.exists()) {
       if (!sessionDir1.isDirectory() || !sessionDir1.canWrite() || !sessionDir1.canRead())
         throw new IOException("Cannot access '"+sessionDir1+"' as a read/writable Directory.");
-      if (checkSessionFiles(sessionDir1)) {
-        createSessionFiles();
-      }
+      this.sessionDir = sessionDir1;//createSessionFiles, need sessionDir attribute set
+      if (!checkSessionFiles(sessionDir1)) 
+        {
+          createSessionFiles();
+        }
         // session files exist in the directory
-        this.sessionDir = sessionDir1;
+        
         initSessionObjects();
         slog.debug("Initialising additional VamsasSession instance");
         log.debug("Attached to VamsasSession in "+sessionDir1);
@@ -355,7 +357,7 @@ public class VamsasSession {
   {
     if (client == null)
       {
-      System.out.println("Try to remove a null client.");
+      //System.out.println("Try to remove a null client.");
         this.slog.error("Try to remove a null client.");
         return;
       }