de.vc.report.storages

## Class FileStorage

- java.lang.Object
- - de.vc.report.ReportStorage
  - - de.vc.report.storages.FileStorage

-     public class FileStorage
      extends ReportStorage

  The file storage puts generated reports into the filesystem. Following pattern is used to create the report filename:

  `<file-prefix><report-index + index-offset><file-suffix>.<extension>
  `

  The extension is provided by the report (MIME-type of report).

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FileStorage(java.lang.String directory)` Creates a new file storage.
    `FileStorage(java.lang.String directory, java.lang.String filePrefix, java.lang.String fileSuffix)` Creates a new file storage.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getDirectory()` Gets the output directory.
    `java.lang.String` | `getFilePrefix()` Gets the file prefix.
    `java.lang.String` | `getFileSuffix()` Gets the file suffix.
    `int` | `getIndexOffset()` Gets the index offset that is added to report index.
    `protected void` | `init()` Invoked by the report engine to initialize this storage before generating reports.
    `void` | `setDirectory(java.lang.String directory)` Sets the output directory.
    `void` | `setFilePrefix(java.lang.String filePrefix)` Sets the file prefix.
    `void` | `setFileSuffix(java.lang.String fileSuffix)` Sets the file suffix (not extension!).
    `void` | `setIndexOffset(int indexOffset)` Sets the report index offset.
    `void` | `storeReport(Report report, ReportContext info)` Invoked by the report engine to store a report.

    - ### Methods inherited from class de.vc.report.ReportStorage

      `finish`

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

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

- - ### Constructor Detail

    - #### FileStorage

          public FileStorage(java.lang.String directory)

      Creates a new file storage.
      Parameters:
        `directory` - Directory where files are stored into.

    - #### FileStorage

          public FileStorage(java.lang.String directory,
                     java.lang.String filePrefix,
                     java.lang.String fileSuffix)

      Creates a new file storage.
      Parameters:
        `directory` - Directory where files are stored into.
        `filePrefix` - Prefix of file-names.
        `fileSuffix` - Suffix of file-names (NOT extension!).

  - ### Method Detail

    - #### storeReport

          public void storeReport(Report report,
                         ReportContext info)
                           throws ReportException

      Description copied from class: `ReportStorage`
      Invoked by the report engine to store a report.
      Specified by:
        `storeReport` in class `ReportStorage`
      Parameters:
        `report` - Report
        `info` - Context of report
      Throws:
        `ReportException`

    - #### init

          protected void init()
                       throws ReportException

      Description copied from class: `ReportStorage`
      Invoked by the report engine to initialize this storage before generating reports.
      Overrides:
        `init` in class `ReportStorage`
      Throws:
        `ReportException`

    - #### getDirectory

          public java.lang.String getDirectory()

      Gets the output directory.
      Returns:
        String

    - #### getFilePrefix

          public java.lang.String getFilePrefix()

      Gets the file prefix.
      Returns:
        String

    - #### getFileSuffix

          public java.lang.String getFileSuffix()

      Gets the file suffix.
      Returns:
        String

    - #### getIndexOffset

          public int getIndexOffset()

      Gets the index offset that is added to report index. The default offset is 1.
      Returns:
        int

    - #### setDirectory

          public void setDirectory(java.lang.String directory)

      Sets the output directory.
      Parameters:
        `directory` - String

    - #### setFilePrefix

          public void setFilePrefix(java.lang.String filePrefix)

      Sets the file prefix.
      Parameters:
        `filePrefix` - String

    - #### setFileSuffix

          public void setFileSuffix(java.lang.String fileSuffix)

      Sets the file suffix (not extension!).
      Parameters:
        `fileSuffix` - String

    - #### setIndexOffset

          public void setIndexOffset(int indexOffset)

      Sets the report index offset. The default offset is 1.
      Parameters:
        `indexOffset` - int

© 2003-2011 by Sascha Schmidt (vision-cloud.de). All Rights Reserved.