MimeHeaders (BEEP Core API)

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.beepcore.beep.core
Class MimeHeaders

    java.lang.Object
      |
      +--org.beepcore.beep.core.MimeHeaders

public class MimeHeaders
extends java.lang.Object

Field Summary
`static java.lang.String` | `BEEP_XML_CONTENT_TYPE` `DataStream` content type ("application/beep+xml");
`static java.lang.String` | `CONTENT_TRANSFER_ENCODING`
`static java.lang.String` | `CONTENT_TYPE`
`static java.lang.String` | `DEFAULT_CONTENT_TRANSFER_ENCODING` The default `DataStream` content transfer encoding ("binary").
`static java.lang.String` | `DEFAULT_CONTENT_TYPE` The default `DataStream` content type ("application/octet-stream").

Constructor Summary
`MimeHeaders()` Creates `MimeHeaders` using the default content type `DEFAULT_CONTENT_TYPE` and default content transfre encoding `DEFAULT_CONTENT_TRANSFER_ENCODING`.
`MimeHeaders(java.lang.String contentType)` Creates `MimeHeaders` using the specified content type and the `DEFAULT_CONTENT_TRANSFER_ENCODING` content transfer encoding.
`MimeHeaders(java.lang.String contentType, java.lang.String transferEncoding)` Creates `MimeHeaders` using the specified content type and content transfer encoding.

Method Summary
`BufferSegment` | `getBufferSegment()`
`java.lang.String` | `getContentType()` Returns the value of the MIME entity header `Content-Type`.
`java.util.Enumeration` | `getHeaderNames()` Returns an `Enumeration` of all the names of the MIME entity headers.
`java.lang.String` | `getHeaderValue(java.lang.String name)` Retrieves the correspoding `value` to a given a MIME entity header `name`.
`java.lang.String` | `getTransferEncoding()` Returns the value of the MIME entity header `Content-Transfer-Encoding`.
`boolean` | `removeHeader(java.lang.String name)` Removes the `name` and `value` of a MIME entity header from the data stream.
`void` | `setContentType(java.lang.String contentType)` Sets the content type of a `DataStream`.
`void` | `setHeader(java.lang.String name, java.lang.String value)` Adds a MIME entity header to this data stream.
`void` | `setTransferEncoding(java.lang.String transferEncoding)` Sets the content transfer encoding of a `DataStream`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### DEFAULT_CONTENT_TYPE

    public static final java.lang.String DEFAULT_CONTENT_TYPE

  The default `DataStream` content type ("application/octet-stream").

  See Also:
    Constant Field Values

### DEFAULT_CONTENT_TRANSFER_ENCODING

    public static final java.lang.String DEFAULT_CONTENT_TRANSFER_ENCODING

  The default `DataStream` content transfer encoding ("binary").

  See Also:
    Constant Field Values

### BEEP_XML_CONTENT_TYPE

    public static final java.lang.String BEEP_XML_CONTENT_TYPE

  `DataStream` content type ("application/beep+xml");

  See Also:
    Constant Field Values

### CONTENT_TYPE

    public static final java.lang.String CONTENT_TYPE

See Also:
  Constant Field Values

### CONTENT_TRANSFER_ENCODING

    public static final java.lang.String CONTENT_TRANSFER_ENCODING

See Also:
  Constant Field Values

Constructor Detail

### MimeHeaders

    public MimeHeaders()

  Creates `MimeHeaders` using the default content type `DEFAULT_CONTENT_TYPE` and default content transfre encoding `DEFAULT_CONTENT_TRANSFER_ENCODING`.

### MimeHeaders

    public MimeHeaders(java.lang.String contentType)

  Creates `MimeHeaders` using the specified content type and the `DEFAULT_CONTENT_TRANSFER_ENCODING` content transfer encoding.

### MimeHeaders

    public MimeHeaders(java.lang.String contentType,
                       java.lang.String transferEncoding)

  Creates `MimeHeaders` using the specified content type and content transfer encoding.

Method Detail

### getContentType

    public java.lang.String getContentType()

  Returns the value of the MIME entity header `Content-Type`.

### getHeaderValue

    public java.lang.String getHeaderValue(java.lang.String name)

  Retrieves the correspoding `value` to a given a MIME entity header `name`.

  Parameters:
    `name` - Name of the MIME entity header.
  Returns:
    The `value` of the MIME entity header.
  Throws:
    `BEEPException`

### getHeaderNames

    public java.util.Enumeration getHeaderNames()

  Returns an `Enumeration` of all the names of the MIME entity headers. Use this call in conjunction with `getHeaderValue` to iterate through all the corresponding MIME entity header `value`(s).

  Returns:
    An `Enumeration` of all the MIME entity header names.

### getTransferEncoding

    public java.lang.String getTransferEncoding()

  Returns the value of the MIME entity header `Content-Transfer-Encoding`.

### removeHeader

    public boolean removeHeader(java.lang.String name)

  Removes the `name` and `value` of a MIME entity header from the data stream. Returns `true` if the `name` was successfully removed.

  Parameters:
    `name` - Name of the header to be removed from the data stream.
  Returns:
    Returns true`if header was removed. Otherwise, returns `false`.`

### setContentType

    public void setContentType(java.lang.String contentType)

  Sets the content type of a `DataStream`.

  Parameters:
    `contentType` -

### setHeader

    public void setHeader(java.lang.String name,
                          java.lang.String value)

  Adds a MIME entity header to this data stream.

  Parameters:
    `name` - Name of the MIME enitity header.
    `value` - Value of the MIME entity header.

### setTransferEncoding

    public void setTransferEncoding(java.lang.String transferEncoding)

  Sets the content transfer encoding of a `DataStream`

  Parameters:
    `transferEncoding` -

### getBufferSegment

    public BufferSegment getBufferSegment()

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright ? 2001 Invisible Worlds, Inc. All Rights Reserved.