org.apache.tapestry5.upload.internal.services

## Class UploadedFileItem

- java.lang.Object
- - org.apache.tapestry5.upload.internal.services.UploadedFileItem

- All Implemented Interfaces:
    UploadedFile

      public class UploadedFileItem
      extends Object
      implements UploadedFile

  Implentation of `UploadedFile` for FileItems.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `UploadedFileItem(org.apache.commons.fileupload.FileItem item)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `cleanup()`
    `String` | `getContentType()`
    `String` | `getFileName()`
    `String` | `getFilePath()`
    `long` | `getSize()`
    `InputStream` | `getStream()`
    `boolean` | `isInMemory()`
    `void` | `write(File file)` Writes the content of the file to a known location.

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

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

- - ### Constructor Detail

    - #### UploadedFileItem

          public UploadedFileItem(org.apache.commons.fileupload.FileItem item)

  - ### Method Detail

    - #### getContentType

          public String getContentType()

      Specified by:
        `getContentType` in interface `UploadedFile`
      Returns:
        the MIME type specified when the file was uploaded.

    - #### getFileName

          public String getFileName()

      Specified by:
        `getFileName` in interface `UploadedFile`
      Returns:
        the name of the file that was uploaded.

    - #### getFilePath

          public String getFilePath()

      Specified by:
        `getFilePath` in interface `UploadedFile`
      Returns:
        the complete path, as reported by the client browser.

    - #### getSize

          public long getSize()

      Specified by:
        `getSize` in interface `UploadedFile`
      Returns:
        the size, in bytes, of the uploaded content.

    - #### getStream

          public InputStream getStream()

      Specified by:
        `getStream` in interface `UploadedFile`
      Returns:
        an input stream of the content of the file.

    - #### isInMemory

          public boolean isInMemory()

      Specified by:
        `isInMemory` in interface `UploadedFile`
      Returns:
        true if the uploaded content is in memory.

    - #### write

          public void write(File file)

      Description copied from interface: `UploadedFile`
      Writes the content of the file to a known location.
      Specified by:
        `write` in interface `UploadedFile`
      Parameters:
        `file` - Location to write file to

    - #### cleanup

          public void cleanup()

5.6.1 - Copyright © 2003-2020 The Apache Software Foundation.