protected void writeDocumentHeader ( XMLEventWriter writer , String repositoryHash , Date currentDate ) throws JournalException { try { putStartDocument ( writer ) ; putStartTag ( writer , QNAME_TAG_JOURNAL ) ; putAttribute ( writer , QNAME_ATTR_REPOSITORY_HASH , repositoryHash ) ; putAttribute ( writer , QNAME_ATTR_TIMESTAMP , JournalHelper . formatDate ( currentDate ) ) ; } catch ( XMLStreamException e ) { throw new JournalException ( e ) ; } }
Subclasses should call this method to initialize a new Journal file if they already know the repository hash and the current date .