org.modeshape.jcr

## Class BackupDocumentReader

- java.lang.Object
- - org.modeshape.jcr.BackupDocumentReader

-     @NotThreadSafe
      public final class BackupDocumentReader
      extends Object

  A utility that writes `Document` instances to one or more sequential files in a backup directory.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected DocumentSequence` | `documents`
    `static String` | `DOCUMENTS_EXTENSION`
    `protected long` | `fileCount`
    `static String` | `GZIP_EXTENSION`
    `protected InputStream` | `stream`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BackupDocumentReader(File parentDirectory, String filenamePrefix, Problems problems)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Close this writer, which flushes and closes any currently-open streams.
    `protected void` | `close(InputStream stream)`
    `protected InputStream` | `openNextFile()`
    `Document` | `read()` Read the next document from the files.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### GZIP_EXTENSION

          public static final String GZIP_EXTENSION

      See Also:
        Constant Field Values

    - #### DOCUMENTS_EXTENSION

          public static final String DOCUMENTS_EXTENSION

      See Also:
        Constant Field Values

    - #### stream

          protected InputStream stream

    - #### documents

          protected DocumentSequence documents

    - #### fileCount

          protected long fileCount

  - ### Constructor Detail

    - #### BackupDocumentReader

          public BackupDocumentReader(File parentDirectory,
                              String filenamePrefix,
                              Problems problems)

  - ### Method Detail

    - #### read

          public Document read()

      Read the next document from the files.
      Returns:
        the document, or null if there are no more documents

    - #### openNextFile

          protected InputStream openNextFile()
                                      throws IOException

      Throws:
        `IOException`

    - #### close

          protected void close(InputStream stream)

    - #### close

          public void close()

      Close this writer, which flushes and closes any currently-open streams. Even after this is called, additional documents can be written to additional files.

Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.