String historyPath = configDir + "/" + HISTORY_FILE_NAME;
File accumuloDir = new File(configDir);
if (!accumuloDir.exists() && !accumuloDir.mkdirs())
log.warn("Unable to make directory for history at " + accumuloDir);
try {
final FileHistory history = new FileHistory(new File(historyPath));
reader.setHistory(history);
// Add shutdown hook to flush file history, per jline javadocs
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
try {
history.flush();
} catch (IOException e) {
log.warn("Could not flush history to file.");
}
}
});