Package marauroa.common.io
Class Persistence
java.lang.Object
marauroa.common.io.Persistence
- Direct Known Subclasses:
FileSystemPersistence,WebstartPersistence
Allows transparent access to files. Subclasses implement Persistence for
normal and webstart environment.
- Author:
- hendrik
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Persistenceget()Returns the Persistence manager for this environmentabstract InputStreamgetInputStream(boolean relativeToHome, String basedir, String filename)Gets an input stream to this "virtual" fileabstract OutputStreamgetOutputStream(boolean relativeToHome, String basedir, String filename)Gets an output stream to this "virtual" file
-
Constructor Details
-
Persistence
public Persistence()
-
-
Method Details
-
get
Returns the Persistence manager for this environment- Returns:
- Persistence
-
getInputStream
public abstract InputStream getInputStream(boolean relativeToHome, String basedir, String filename) throws IOExceptionGets 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 environmentfilename- filename (without path)- Returns:
- InputStream
- Throws:
IOException- on IO error
-
getOutputStream
public abstract OutputStream getOutputStream(boolean relativeToHome, String basedir, String filename) throws IOExceptionGets 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 environmentfilename- filename (without path)- Returns:
- OutputStream
- Throws:
IOException- on IO error
-