EmptyDataSource

public class EmptyDataSource implements DataSource

NullDataSource is an implementation of the javax.activation.DataSource that represents a empty, but not null. datasource Creation Date: 7/11/2006

Author:Twinsen Tsang

Constructors

EmptyDataSource

public EmptyDataSource()

Default Constructor. The name is set to empty and the content type is set to application/octect-stream.

EmptyDataSource

public EmptyDataSource(String name, String contentType)

Explicit Constructor.

Parameters:
  • name – The name of the datasource.
  • contentType – The content type of the datasource.

Methods

getContentType

public String getContentType()

Get the name of content type.

getInputStream

public InputStream getInputStream()

This method will return an InputStream representing the the data and will throw an IOException if it can not do so. This method will return a new instance of NullInputStream with each invocation

See also: hk.hku.cecid.edi.sfrm.io.NullInputStream

getName

public String getName()

Get the name of the datasource.

getOutputStream

public OutputStream getOutputStream()

This method always throw IO exception.

Throws:
  • IOException – as output stream is not supported by this data source.

See also: javax.activation.DataSource.getOutputStream()