protected History prepareHistory ( ) throws IOException { File file = new File ( System . getProperty ( "user.home" ) , HISTORYFILE ) ; if ( ! file . exists ( ) ) { try { file . createNewFile ( ) ; } catch ( IOException ignored ) { // can't create the file, so no history for you } } return file . canWrite ( ) ? new FileHistory ( file ) : null ; }
Prepares a history file to be used by the ConsoleReader . This file will live in the home directory of the user .