Class FileHistory
java.lang.Object
org.aesh.readline.history.History
org.aesh.readline.history.InMemoryHistory
org.aesh.readline.history.FileHistory
Read the history file at init and writeToStdOut to it at shutdown
- Author:
- Ståle W. Pedersen
-
Constructor Summary
ConstructorsConstructorDescriptionFileHistory(File file, int maxSize) Creates a FileHistory with the specified file and maximum size.FileHistory(File file, int maxSize, boolean logging) Creates a FileHistory with the specified file, maximum size, and logging option.FileHistory(File file, int maxSize, FileAccessPermission historyFilePermission, boolean logging) Creates a FileHistory with full configuration options. -
Method Summary
Modifier and TypeMethodDescriptionvoidstop()Stops the history and performs any necessary cleanup (e.g., saving to file).Methods inherited from class InMemoryHistory
clear, find, get, getAll, getCurrent, getNextFetch, getPreviousFetch, getSearchDirection, push, search, setCurrent, setSearchDirection, size
-
Constructor Details
-
FileHistory
Creates a FileHistory with the specified file and maximum size.- Parameters:
file- the history filemaxSize- the maximum number of history entries
-
FileHistory
Creates a FileHistory with the specified file, maximum size, and logging option.- Parameters:
file- the history filemaxSize- the maximum number of history entrieslogging- whether to log warnings and errors
-
FileHistory
public FileHistory(File file, int maxSize, FileAccessPermission historyFilePermission, boolean logging) Creates a FileHistory with full configuration options.- Parameters:
file- the history filemaxSize- the maximum number of history entrieshistoryFilePermission- the file access permissions to set on the history filelogging- whether to log warnings and errors
-
-
Method Details
-
stop
public void stop()Description copied from class:HistoryStops the history and performs any necessary cleanup (e.g., saving to file).- Overrides:
stopin classInMemoryHistory
-