lv.pasts.eme.edoc

## Interface EDOCDataFile

-     public interface EDOCDataFile

  A `EDOCDataFile` class represents file contained by the EDOC document.
  See Also:
    `EDOC.addFile(File)`, `EDOC.getFile(String)`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getFileName()` Returns the name of the file represented by this EDOC data file.
    `InputStream` | `getInputStream()` Returns an `InputStream` for reading data from this `EDOCDataFile`.
    `String` | `getName()` Returns the internal name of this EDOC data file.
    `long` | `getSize()` Returns the size of this EDOC data file.
    `File` | `getTemporaryFile()` Returns a `File` for reading data from this `EDOCDataFile`.
    `File` | `saveTo(File directory)` Saves this EDOC data file to the given directory using the current file name.
    `File` | `saveTo(File directory, String name)` Saves this EDOC data file to the given directory using the given name.

- - ### Method Detail

    - #### getName

          String getName()

      Returns the internal name of this EDOC data file.
      Returns:
        the internal name of this data file.

    - #### getFileName

          String getFileName()

      Returns the name of the file represented by this EDOC data file.
      Returns:
        the name of the file.

    - #### getSize

          long getSize()

      Returns the size of this EDOC data file.
      Returns:
        the size, in bytes, of this EDOC data file.

    - #### saveTo

          File saveTo(File directory)
               throws EDOCException

      Saves this EDOC data file to the given directory using the current file name.
      Parameters:
        `directory` - a directory where this `EDOCDataFile` should be saved.
      Returns:
        the saved file.
      Throws:
        `EDOCException` - if this data file cannot be saved.

    - #### saveTo

          File saveTo(File directory,
                      String name)
               throws EDOCException

      Saves this EDOC data file to the given directory using the given name.
      Parameters:
        `directory` - a directory where this `EDOCDataFile` should be saved.
        `name` - the name of the target file.
      Returns:
        the saved file.
      Throws:
        `EDOCException` - if this data file cannot be saved.

    - #### getInputStream

          InputStream getInputStream()
                              throws IOException

      Returns an `InputStream` for reading data from this `EDOCDataFile`.

      NOTE: the implementation is responsible for closing the returned `InputStream`.

      Returns:
        an `InputStream` for reading data from this `EDOCDataFile`.
      Throws:
        `IOException` - if this data file cannot be accessed.

    - #### getTemporaryFile

          File getTemporaryFile()
                         throws IOException

      Returns a `File` for reading data from this `EDOCDataFile`.

      NOTE: Do not modify the underlying file, as it will corrupt the EDOC integrity!

      Returns:
        a `File` instance.
      Throws:
        `IOException` - if this data file cannot be accessed.

Copyright VAS Latvijas Valsts radio un televizijas centrs / Developed by SIA EUSO