Perforce

com.perforce.reviewer
Class StringDataSource

java.lang.Object
  |
  +--com.perforce.reviewer.StringDataSource
All Implemented Interfaces:
DataSource

public class StringDataSource
extends Object
implements DataSource

Implements a DataSource from a String. This is useful for creating an HTML DataSource that can be used in sending out e-mail.

This class is used by the built-in MailListener class. It is public, so it can be used by other ChangeListener implementations. Take a look at the package sources to see how MailListener uses it.

Most users of the Reviewer may not need to be concerned with this class.

Version:
$Date: 2002/01/11 $ $Revision: #2 $
Author:
David Markley
See Also:
ChangeListener, DataSource

Constructor Summary
StringDataSource(String data)
           
StringDataSource(String data, String type)
           
StringDataSource(String data, String type, String encoding)
           
 
Method Summary
 String getContentType()
           
 String getEncoding()
           
 InputStream getInputStream()
          Return an InputStream for the data.
 String getName()
           
 OutputStream getOutputStream()
          Required to implement DataSource, but invalid.
 void setContentType(String type)
           
 void setEncoding(String encoding)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringDataSource

public StringDataSource(String data)

StringDataSource

public StringDataSource(String data,
                        String type)

StringDataSource

public StringDataSource(String data,
                        String type,
                        String encoding)
Method Detail

getContentType

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

getEncoding

public String getEncoding()

getInputStream

public InputStream getInputStream()
                           throws IOException
Return an InputStream for the data.
Specified by:
getInputStream in interface DataSource

getName

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

getOutputStream

public OutputStream getOutputStream()
                             throws IOException
Required to implement DataSource, but invalid. This will always throw an IOException.
Specified by:
getOutputStream in interface DataSource

setContentType

public void setContentType(String type)

setEncoding

public void setEncoding(String encoding)

Perforce

Copyright © 2001, Perforce Software, All rights reserved.