2 package org.vamsas.client.simpleclient;
5 import java.io.FileOutputStream;
6 import java.io.FileReader;
7 import java.io.IOException;
8 import java.io.InputStream;
9 import java.io.InputStreamReader;
10 import java.io.PrintWriter;
11 import java.util.Timer;
12 import java.util.jar.JarEntry;
13 import java.util.jar.JarFile;
14 import java.util.jar.JarInputStream;
15 import java.util.jar.JarOutputStream;
17 import org.vamsas.objects.core.LockFileDescriptor;
20 * low level vamsas document management routines
21 * analogous to ClientsFile
22 * This class is not thread safe.
26 public class VamsasFile extends SessionFile {
29 * Connect to an existing Vamsas document in a given sessionDir
30 * or create a new one.
33 * @throws java.io.IOException
35 public VamsasFile(File sessionFile) throws java.io.IOException {
39 * Expand a previously stored session into the sessionDir
41 * @param storedSession
43 public VamsasFile(File sessionDir, JarFile storedSession) throws IOException {
44 // check if sessionDir is live or not
46 // if live - try to merge storedSession with sessionDir
47 // - will probably fail through duplicate object references needing to be dereferenced.
48 // TODO: think of a way of specifying vorba_id scope for an application's references to allow merging of one vamsasDocument with another.
52 * gets a locked Reader for the vamsas document.
53 * @return reader for vamsasdocument.xml enrty
55 public java.io.Reader getDocumentReader() {
58 JarFile session = new JarFile("vamsasJar");
59 //JarEntry vamsasDocument = session.getJarEntry("vamsasDocument.xml");
60 //return new InputStreamReader(session.getInputStream(vamsasDocument));
61 } catch (IOException e) {
62 // TODO Auto-generated catch block