org.apache.synapse.commons.vfs

## Class FileObjectDataSource

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

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

      public class FileObjectDataSource
      extends java.lang.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 and Description
    `FileObjectDataSource(org.apache.commons.vfs2.FileObject file, java.lang.String contentType)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getContentType()`
    `java.io.InputStream` | `getInputStream()`
    `java.lang.String` | `getName()`
    `java.io.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,
                                      java.lang.String contentType)

  - ### Method Detail

    - #### getSize

          public long getSize()

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

    - #### getContentType

          public java.lang.String getContentType()

      Specified by:
        `getContentType` in interface `javax.activation.DataSource`

    - #### getName

          public java.lang.String getName()

      Specified by:
        `getName` in interface `javax.activation.DataSource`

    - #### getInputStream

          public java.io.InputStream getInputStream()
                                             throws java.io.IOException

      Specified by:
        `getInputStream` in interface `javax.activation.DataSource`
      Throws:
        `java.io.IOException`

    - #### getOutputStream

          public java.io.OutputStream getOutputStream()
                                               throws java.io.IOException

      Specified by:
        `getOutputStream` in interface `javax.activation.DataSource`
      Throws:
        `java.io.IOException`

Copyright © 2005-2022 Apache Software Foundation. All Rights Reserved.