Package org.apache.synapse.commons.vfs

## Class FileObjectDataSource

- java.lang.Object
- - org.apache.synapse.commons.vfs.FileObjectDataSource

- All Implemented Interfaces:
    `DataSource`, `org.apache.axiom.attachments.SizeAwareDataSource`, `org.apache.axiom.ext.activation.SizeAwareDataSource`

      public class FileObjectDataSource
      extends Object
      implements org.apache.axiom.attachments.SizeAwareDataSource

  Data source that reads data from a VFS `FileObject`. This class is similar to VFS' own FileObjectDataSource implementation, but in addition implements `SizeAwareDataSource`.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `FileObjectDataSource​(org.apache.commons.vfs2.FileObject file, String contentType)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `String` | `getContentType()` |
    `InputStream` | `getInputStream()` |
    `String` | `getName()` |
    `OutputStream` | `getOutputStream()` |
    `long` | `getSize()` |

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

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

- - ### Constructor Detail

    - #### FileObjectDataSource

          public FileObjectDataSource​(org.apache.commons.vfs2.FileObject file,
                                      String contentType)

  - ### Method Detail

    - #### getSize

          public long getSize()

      Specified by:
        `getSize` in interface `org.apache.axiom.ext.activation.SizeAwareDataSource`

    - #### getContentType

          public String getContentType()

      Specified by:
        `getContentType` in interface `DataSource`

    - #### getName

          public String getName()

      Specified by:
        `getName` in interface `DataSource`

    - #### getInputStream

          public InputStream getInputStream()
                                     throws IOException

      Specified by:
        `getInputStream` in interface `DataSource`
      Throws:
        `IOException`

    - #### getOutputStream

          public OutputStream getOutputStream()
                                       throws IOException

      Specified by:
        `getOutputStream` in interface `DataSource`
      Throws:
        `IOException`