public TxnLogToolkit(boolean recoveryMode, boolean verbose, String txnLogFileName, boolean force)
throws FileNotFoundException, TxnLogToolkitException {
this.recoveryMode = recoveryMode;
this.verbose = verbose;
this.force = force;
txnLogFile = new File(txnLogFileName);
if (!txnLogFile.exists() || !txnLogFile.canRead()) {
throw new TxnLogToolkitException(1, "File doesn't exist or not readable: %s", txnLogFile);
}
if (recoveryMode) {
recoveryLogFile = new File(txnLogFile.toString() + ".fixed");
if (recoveryLogFile.exists()) {
throw new TxnLogToolkitException(1, "Recovery file %s already exists or not writable", recoveryLogFile);
}
}
openTxnLogFile();
if (recoveryMode) {
openRecoveryFile();
}
}