Class Persistence

java.lang.Object
marauroa.common.io.Persistence
Direct Known Subclasses:
FileSystemPersistence, WebstartPersistence

public abstract class Persistence extends Object
Allows transparent access to files. Subclasses implement Persistence for normal and webstart environment.
Author:
hendrik
  • Constructor Details

    • Persistence

      public Persistence()
  • Method Details

    • get

      public static Persistence get()
      Returns the Persistence manager for this environment
      Returns:
      Persistence
    • getInputStream

      public abstract InputStream getInputStream(boolean relativeToHome, String basedir, String filename) throws IOException
      Gets an input stream to this "virtual" file
      Parameters:
      relativeToHome - should this file be placed below the users home directory?
      basedir - directory prefix which is ignore in webstart environment
      filename - filename (without path)
      Returns:
      InputStream
      Throws:
      IOException - on IO error
    • getOutputStream

      public abstract OutputStream getOutputStream(boolean relativeToHome, String basedir, String filename) throws IOException
      Gets an output stream to this "virtual" file
      Parameters:
      relativeToHome - should this file be placed below the users home directory?
      basedir - directory prefix which is ignore in webstart environment
      filename - filename (without path)
      Returns:
      OutputStream
      Throws:
      IOException - on IO error