+ /**
+ * Replaces data in sessionFile with data from file handled by another sessionFile
+ * passes up any exceptions.
+ * @param newData source for new data
+ */
+ protected void updateFrom(Lock extantLock, SessionFile newData) throws IOException {
+ log.debug("Updating "+sessionFile.getAbsolutePath()+" from "+newData.sessionFile.getAbsolutePath());
+ if (newData==null)
+ throw new IOException("Null newData object.");
+ if (newData.sessionFile==null)
+ throw new IOException("Null SessionFile in newData.");
+
+ lockFile(extantLock);
+ newData.lockFile();
+ fileLock.rafile.getChannel().transferFrom(newData.fileLock.rafile.getChannel(), 0,
+ newData.fileLock.rafile.length());
+ }