jline.console.history
Class FileHistory
java.lang.Object
jline.console.history.MemoryHistory
jline.console.history.FileHistory
- All Implemented Interfaces:
- Flushable, Iterable<History.Entry>, History, PersistentHistory
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.
- Since:
- 2.0
- Author:
- Jason Dillon
Methods inherited from class jline.console.history.MemoryHistory |
add, clear, current, entries, entries, get, getMaxSize, index, isAutoTrim, isEmpty, isIgnoreDuplicates, iterator, moveTo, moveToEnd, moveToFirst, moveToLast, next, previous, replace, setAutoTrim, setIgnoreDuplicates, setMaxSize, size |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface jline.console.history.History |
add, clear, current, entries, entries, get, index, isEmpty, iterator, moveTo, moveToEnd, moveToFirst, moveToLast, next, previous, replace, size |
FileHistory
public FileHistory(File file)
throws IOException
- Throws:
IOException
getFile
public File getFile()
load
public void load(File file)
throws IOException
- Throws:
IOException
load
public void load(InputStream input)
throws IOException
- Throws:
IOException
load
public void load(Reader reader)
throws IOException
- Throws:
IOException
flush
public void flush()
throws IOException
- Description copied from interface:
PersistentHistory
- Flush all items to persistent storage.
- Specified by:
flush
in interface Flushable
- Specified by:
flush
in interface PersistentHistory
- Throws:
IOException
- Flush failed
purge
public void purge()
throws IOException
- Description copied from interface:
PersistentHistory
- Purge persistent storage and
History.clear()
.
- Specified by:
purge
in interface PersistentHistory
- Throws:
IOException
- Purge failed
Copyright © 2008-2011 Sonatype. All Rights Reserved.