org.apache.myfaces.trinidad.model

## Interface UploadedFile

- All Known Implementing Classes:
    ExtendedUploadedFile

      public interface UploadedFile

  Interface that describes the contents of a single file.
  See Also:
    `CoreInputFile`

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `dispose()` Disposes all resources allocated for this file.
    `String` | `getContentType()` Returns the MIME type of the file.
    `String` | `getFilename()` Returns the filename reported by the client.
    `InputStream` | `getInputStream()` Returns an InputStream that can be used to read the file.
    `long` | `getLength()` Returns the total length (in bytes) of the file.
    `Object` | `getOpaqueData()` Return opaque data associated with the file when it was processed by the `UploadedFileProcessor`.

- - ### Method Detail

    - #### getFilename

          String getFilename()

      Returns the filename reported by the client.

    - #### getContentType

          String getContentType()

      Returns the MIME type of the file.

    - #### getLength

          long getLength()

      Returns the total length (in bytes) of the file. A length of -1 is interpreted as an error situation, and will be treated as JSF convertor failure. When this happens, the details of this error is expected to be in the toString() implementation of the object returned through getOpaqueData(). This detail will be displayed to the user as a conversion failure message.
      See Also:
        `getOpaqueData()`

    - #### getOpaqueData

          Object getOpaqueData()

      Return opaque data associated with the file when it was processed by the `UploadedFileProcessor`. This is always null with the default `UploadedFileProcessor`, but custom implementations may use this to pass additional information needed for later processing. (Note that Apache Trinidad cannot cannot guarantee that the instance returned from code>UploadedFileProcessor is the same one made available later.
      See Also:
        `getLength()`

    - #### getInputStream

          InputStream getInputStream()
                                     throws IOException

      Returns an InputStream that can be used to read the file. This method can be called repeatedly.
      Throws:
        `IOException`

    - #### dispose

          void dispose()

      Disposes all resources allocated for this file.

Copyright © 2001-2017 The Apache Software Foundation. All Rights Reserved.