import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.commons.logging.impl.Log4jFactory;
/**
* Basic methods for classes handling locked IO on files
* monitored by all (simpleclient) clients in a vamsas session.
* @author jimp
- *
+ *TODO: support non nio file locking capable systems
*/
public class SessionFile {
private static Log log = LogFactory.getLog(SessionFile.class);
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Hashtable;
-import java.util.Map;
import java.util.jar.JarEntry;
-import java.util.jar.JarInputStream;
import java.util.jar.JarOutputStream;
import org.apache.commons.logging.Log;
if (!archive.getAbsolutePath().equals(original)) {
if (originalBackup==null)
makeBackup();
+ try {
+ odoclock.updateFrom(null, rchive);
+ }
+ catch (IOException e) {
+ log.error("Problem updating archive from temporary file!",e);
+ }
}
} else {
archive.renameTo(original);
if (!isDocumentWritten())
log.warn("Premature closure of archive '"+archive.getAbsolutePath()+"': No document has been written.");
newarchive.close();
+ updateOriginal();
closeAndReset();
} else {
log.warn("Attempt to close archive that has not been opened for writing.");