code: @Override
      public void openFile(String repositoryHash,
                           String filename,
                           Date currentDate) throws JournalException {
          try {
              super.testStateChange(State.FILE_OPEN);
  
              journalFile = new TransportOutputFile(directory, filename);
  
              xmlWriter =
                      new IndentingXMLEventWriter(XMLOutputFactory.newInstance()
                              .createXMLEventWriter(journalFile.open()));
  
              parent.writeDocumentHeader(xmlWriter, repositoryHash, currentDate);
  
              super.setState(State.FILE_OPEN);
          } catch (FactoryConfigurationError e) {
              throw new JournalException(e);
          } catch (XMLStreamException e) {
              throw new JournalException(e);
          } catch (IOException e) {
              throw new JournalException(e);
          }
      }
docs: On a request to open the file,
  <ul>
  <li>check that we are in a valid state,</li>
  <li>create the file,</li>
  <li>create the {@link XMLEventWriter} for use on the file,</li>
  <li>ask the parent to write the header to the file,</li>
  <li>set the state.</li>
  </ul>