ref_send API 1.16
defensive programming in Java

org.web_send
Class Entity

java.lang.Object
  extended by org.web_send.Entity
All Implemented Interfaces:
java.io.Serializable, Immutable, Powerless, Selfless

public final class Entity
extends java.lang.Object
implements Powerless, Selfless, java.io.Serializable

A MIME entity.

See Also:
Serialized Form

Field Summary
static java.lang.String binary
          binary Media Type: "application/octet-stream"
 ByteArray content
          binary content
static int maxContentSize
          maximum number of bytes in content: 262144
static PowerlessArray<java.lang.String> supported
          supported Media Types
 java.lang.String type
          Media Type
 
Constructor Summary
Entity(java.lang.String type, ByteArray content)
          Constructs an instance.
 
Method Summary
 boolean equals(java.lang.Object o)
          Is the given object the same?
 int hashCode()
          Calculates the hash code.
static boolean supports(java.lang.String type)
          Is a given Media Type supported?
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

maxContentSize

public static final int maxContentSize
maximum number of bytes in content: 262144

See Also:
Constant Field Values

binary

public static final java.lang.String binary
binary Media Type: "application/octet-stream"

See Also:
Constant Field Values

supported

public static final PowerlessArray<java.lang.String> supported
supported Media Types

Some Media Types, such as HTML, are automatically provided with additional permissions by the web browser, such as the permission to script other browser frames from the same origin. Consequently, it is not always safe to serve such content. This field lists the known safe and so supported Media Types.


type

public final java.lang.String type
Media Type


content

public final ByteArray content
binary content

Constructor Detail

Entity

public Entity(java.lang.String type,
              ByteArray content)
       throws Failure
Constructs an instance.

Parameters:
type - type
content - content
Throws:
Failure - content bigger than maxContentSize
Method Detail

supports

public static boolean supports(java.lang.String type)
Is a given Media Type supported?

Parameters:
type - Media Type

equals

public boolean equals(java.lang.Object o)
Is the given object the same?

Overrides:
equals in class java.lang.Object
Parameters:
o - compared to object
Returns:
true if the same, else false

hashCode

public int hashCode()
Calculates the hash code.

Specified by:
hashCode in interface Selfless
Overrides:
hashCode in class java.lang.Object

ref_send API 1.16
defensive programming in Java

Submit a bug or feature, or get help

Copyright 1998-2007 Waterken Inc. under the terms of the MIT X license.