public class FileHistory extends MemoryHistory implements PersistentHistory, Flushable
History using a file for persistent backing.
Implementers should install shutdown hook to call flush()
to save history to disk.History.EntryDEFAULT_MAX_SIZE| Constructor and Description |
|---|
FileHistory(File file) |
| Modifier and Type | Method and Description |
|---|---|
void |
flush()
Flush all items to persistent storage.
|
File |
getFile() |
void |
load(File file) |
void |
load(InputStream input) |
void |
load(Reader reader) |
void |
purge()
Purge persistent storage and
History.clear(). |
add, clear, current, entries, entries, get, getMaxSize, index, internalAdd, isAutoTrim, isEmpty, isIgnoreDuplicates, iterator, moveTo, moveToEnd, moveToFirst, moveToLast, next, previous, remove, removeFirst, removeLast, replace, set, setAutoTrim, setIgnoreDuplicates, setMaxSize, size, toStringpublic FileHistory(File file) throws IOException
IOExceptionpublic File getFile()
public void load(File file) throws IOException
IOExceptionpublic void load(InputStream input) throws IOException
IOExceptionpublic void load(Reader reader) throws IOException
IOExceptionpublic void flush()
throws IOException
PersistentHistoryflush in interface Flushableflush in interface PersistentHistoryIOException - Flush failedpublic void purge()
throws IOException
PersistentHistoryHistory.clear().purge in interface PersistentHistoryIOException - Purge failedCopyright © 2014. All Rights Reserved.