|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.ace.repository.ext.impl.FilebasedBackupRepository
public class FilebasedBackupRepository
A file-based implementation of the Backup Repository, using two files to store the current and backup version.
Constructor Summary | |
---|---|
FilebasedBackupRepository(File current,
File backup)
Creates a FilebasedBackupRepository. |
Method Summary | |
---|---|
boolean |
backup()
Backs up the current version of the object, overwriting a previous backup, if any. |
InputStream |
read()
Reads the input stream from the current object. |
boolean |
restore()
Restores a previously backuped version of the object. |
String |
toString()
|
void |
write(InputStream data)
Writes the input stream to the current object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FilebasedBackupRepository(File current, File backup)
current
- A file to store the current revision in.backup
- A file to store a backup version in.Method Detail |
---|
public InputStream read() throws IOException
BackupRepository
read
in interface BackupRepository
IOException
- Will be thrown when there is a problem storing the data.public void write(InputStream data) throws IOException
BackupRepository
write
in interface BackupRepository
data
- The data to be written. Remember to close this stream, if necessary.
IOException
- Will be thrown when (a) the input stream gets closed
unexpectedly, or (b) there is an error writing the data.public boolean backup() throws IOException
BackupRepository
backup
in interface BackupRepository
IOException
- Thrown when the restore process goes bad.public boolean restore() throws IOException
BackupRepository
restore
in interface BackupRepository
IOException
- Thrown when the restore process goes bad.public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |