com.infoengine.SAK
Class Content

java.lang.Object
  extended by com.infoengine.SAK.Content

public class Content
extends java.lang.Object

This class provides access to one part of a MIME multipart object stream.

Version:
1.0 2/19/2000

Constructor Summary
Content(com.infoengine.SAK.ContentInputStream inputStream)
          Constructor that initializes the instance to read from a multipart MIME stream.
Content(java.io.InputStream inputStream, java.lang.String contentType)
          Constructor that initializes the instance to read from a non-multipart MIME stream.
 
Method Summary
 java.lang.String getContentType()
          Return the MIME type of the content.
 java.lang.String getDisposition()
          Return the disposition of the content.
 java.lang.String getFileName()
          Return the file name of the content.
 java.lang.String getHeader(java.lang.String key)
          Return the text specified in a MIME header associated with the content object.
 java.util.Enumeration getHeaderKeys()
          Return an Enumeration of all MIME header keywords associated with the content object.
 java.io.InputStream getInputStream()
          Return an input stream that can be used to read the body of the content object.
 java.lang.String getName()
          Return the name of the content.
 java.lang.String toString()
          Read the body of the content object, and return it as a String.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Content

public Content(java.io.InputStream inputStream,
               java.lang.String contentType)
Constructor that initializes the instance to read from a non-multipart MIME stream.

Parameters:
inputStream - input stream
contentType - MIME content type associated with the input stream

Content

public Content(com.infoengine.SAK.ContentInputStream inputStream)
Constructor that initializes the instance to read from a multipart MIME stream.

Parameters:
inputStream - input stream
Method Detail

getContentType

public java.lang.String getContentType()
Return the MIME type of the content.

Returns:
The MIME type

getDisposition

public java.lang.String getDisposition()
Return the disposition of the content. A common disposition is "form-data", indicating that the content is an element from a submitted HTML form.

Returns:
The disposition type

getName

public java.lang.String getName()
Return the name of the content. When the content is an element of a submitted HTML form, the name will usually be the name of the form variable associated with the content.

Returns:
The name of the content

getFileName

public java.lang.String getFileName()
Return the file name of the content. When the content is an element of a submitted HTML form, and the element represents file content being uploaded via the form, the element will usually have a file name component.

Returns:
The file name associated with the content, or null if the content is not associated with a file name

getHeader

public java.lang.String getHeader(java.lang.String key)
Return the text specified in a MIME header associated with the content object.

Parameters:
key - the MIME header keyword
Returns:
The text of the header identified by the keyword, or null if the content object does not have a header with the specified keyword

getHeaderKeys

public java.util.Enumeration getHeaderKeys()
Return an Enumeration of all MIME header keywords associated with the content object.

Returns:
The list of header keywords associated with the content object

getInputStream

public java.io.InputStream getInputStream()
Return an input stream that can be used to read the body of the content object.

Returns:
An input stream that be used to read the body of the content object

toString

public java.lang.String toString()
Read the body of the content object, and return it as a String.

Overrides:
toString in class java.lang.Object
Returns:
A String containing the body of the content object