/** Create or open log files used by this log. */ private void createOrOpenLogFiles() throws ChangelogException { exclusiveLock.lock(); try { createRootDirIfNotExists(); openHeadLogFile(); for (final File file : getReadOnlyLogFiles()) { openReadOnlyLogFile(file); } isClosed = false; } catch (ChangelogException e) { // ensure all log files opened at this point are closed close(); throw new ChangelogException( ERR_CHANGELOG_UNABLE_TO_INITIALIZE_LOG.get(logPath.getPath()), e); } finally { exclusiveLock.unlock(); } }