Class StreamingOnRequestDataSource

java.lang.Object
org.wso2.carbon.relay.StreamingOnRequestDataSource
All Implemented Interfaces:
DataSource

public class StreamingOnRequestDataSource extends Object implements DataSource
This class has a special flag, which says this is it's last use and not to cache data if it did not have done so already.
Author:
Srinath Perera (srinath@wso2.com)
  • Constructor Details

    • StreamingOnRequestDataSource

      public StreamingOnRequestDataSource(InputStream in)
  • Method Details

    • getContentType

      public String getContentType()
      Specified by:
      getContentType in interface DataSource
    • getInputStream

      public InputStream getInputStream() throws IOException
      Specified by:
      getInputStream in interface DataSource
      Throws:
      IOException
    • getName

      public String getName()
      Specified by:
      getName in interface DataSource
    • getOutputStream

      public OutputStream getOutputStream() throws IOException
      Specified by:
      getOutputStream in interface DataSource
      Throws:
      IOException
    • setLastUse

      public void setLastUse(boolean lastUse)
      This flag says that this is the last use of the stream, hence do not need to cache it if it has not already cached.
      Parameters:
      lastUse -
    • isConsumed

      public boolean isConsumed()
      Indicates whether or not the InputStream of the message has been consumed
      Returns:
      true if the InputStream has already been consumed, false otherwise.