Oracle

com.compoze.util
Class StringDataSource

java.lang.Object
  extended by com.compoze.util.StringDataSource

public class StringDataSource
extends java.lang.Object

This class implements a data source for strings.


Constructor Summary
StringDataSource(java.lang.String sData, java.lang.String sAttachmentName)
          Constructor.
StringDataSource(java.lang.String sData, java.lang.String sContentType, java.lang.String sAttachmentName)
          Constructor.
StringDataSource(java.lang.String sData, java.lang.String sContentType, java.lang.String sCharacterEncoding, java.lang.String sAttachmentName)
          Constructor.
 
Method Summary
 java.lang.String getContentType()
          Get the content-type of the data.
 java.io.InputStream getInputStream()
          Get an input stream to the data.
 java.lang.String getName()
          Get the name of the attachment.
 java.io.OutputStream getOutputStream()
          Get an output stream to the data (not supported).
 void setContentType(java.lang.String sContentType)
          Set the content-type of the data.
 void setName(java.lang.String sName)
          Set the name of the attachment.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringDataSource

public StringDataSource(java.lang.String sData,
                        java.lang.String sAttachmentName)
Constructor. The content-type defaults to text/plain.

Parameters:
sData - the string
sAttachmentName - the attachment name

StringDataSource

public StringDataSource(java.lang.String sData,
                        java.lang.String sContentType,
                        java.lang.String sAttachmentName)
Constructor.

Parameters:
sData - the string
sContentType - the content-type
sAttachmentName - the attachment name

StringDataSource

public StringDataSource(java.lang.String sData,
                        java.lang.String sContentType,
                        java.lang.String sCharacterEncoding,
                        java.lang.String sAttachmentName)
Constructor.

Parameters:
sData - the string
sContentType - the content-type
sCharacterEncoding - the character encoding
sAttachmentName - the attachment name
Method Detail

getContentType

public java.lang.String getContentType()
Get the content-type of the data.

Returns:
the content-type of the data

setContentType

public void setContentType(java.lang.String sContentType)
Set the content-type of the data.

Parameters:
sContentType - the content-type of the data

getName

public java.lang.String getName()
Get the name of the attachment.

Returns:
the name of the attachment

setName

public void setName(java.lang.String sName)
Set the name of the attachment.

Parameters:
sName - the name of the attachment

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.UnsupportedEncodingException
Get an input stream to the data.

Returns:
an input stream to the data
Throws:
java.io.UnsupportedEncodingException

getOutputStream

public java.io.OutputStream getOutputStream()
                                     throws java.io.IOException
Get an output stream to the data (not supported).

Returns:
the output stream to the data
Throws:
java.io.IOException - always thrown because operation not supported

Oracle

Copyright ©1999-2008 Oracle All rights reserved.