Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.mitre.cvw
Class HTTPReply  view HTTPReply download HTTPReply.java

java.lang.Object
  extended byorg.mitre.cvw.HTTPReply

class HTTPReply
extends java.lang.Object

A basic HTTP class object.

Version:
1

Field Summary
(package private)  int EHctr
           
(package private)  byte[] Entity
           
(package private)  int entityFileLength
           
(package private)  java.lang.String[] EntityHeaders
           
(package private)  int entityLength
           
(package private)  java.lang.String entityPath
           
(package private)  java.lang.String[] GeneralHeaders
           
(package private)  int GHctr
           
(package private)  java.lang.String HTTPVers
           
(package private)  int maxBufSize
           
(package private)  java.lang.String mimeType
           
(package private)  NPDocServer plugin
           
(package private)  java.lang.String[] ResponseHeaders
           
(package private)  int returnCode
           
(package private)  int RHctr
           
(package private)  java.lang.String StatusCode
           
(package private)  java.lang.String StatusMessage
           
(package private)  java.lang.String tmpDir
           
(package private) static int uniqueID
           
 
Constructor Summary
HTTPReply(NPDocServer pi, java.lang.String tmp)
          The HTTP class constructor.
 
Method Summary
 void Add(byte b)
          Add one byte to the entity body
 void Add(byte[] b, int len)
          Add bytes to the entity body -- added plain, no modification.
 void Add(java.lang.String line)
          Add a line in the form of a string to the entity body.
 void AddEHeader(java.lang.String field, java.lang.String value)
          Add an Entity header
 void AddGHeader(java.lang.String field, java.lang.String value)
          Add a General header
 void AddHeader(java.lang.String line, int level)
          Adds a line as an HTML-style header, level "level"
 void AddHTML(java.lang.String line)
          Add a line of html code to a message.
 void AddRHeader(java.lang.String field, java.lang.String value)
          Add a Response header
 void AddTitle(java.lang.String line)
          Add a title to the message.
 void beginBody()
          Begin the message body.
 void beginHead()
          Begin the message header.
 void endBody()
          End the message body.
 void endHead()
          End the message header.
protected  void finalize()
          Clean up the garbage left over from the transaction.
 byte[] getEntity()
          Retrieve the entity itself
 int getEntityLength()
          Get the length of the entity.
 java.lang.String getEntityPath()
          Retrieve a reference to an entity
 java.lang.String getHeader(java.lang.String header)
          Parse a header from a string
private  java.lang.String getNewFileName()
          Generate a unique file name
 int getReturnCode()
          Retrieve the reply return code
private  int getUniqueID()
          Get a unique id number.
 void SetContentType(java.lang.String mime)
          Add a Mime type
 void SetContentType(java.lang.String mimeMainType, java.lang.String mimeSubType)
          Add a Mime type
 void setEntity(java.io.DataInputStream I)
          Transfer data from the server to the local directory
 void setEntityLength(int len)
          Specify the entity length of the message
 void SetErrMessage(java.lang.String msg)
          Add an error message
 void setReturnCode(int code)
          Set the return code from the server transaction
 void SetStatCode(java.lang.String error)
          Add a Status code
 void writeOut(java.io.DataOutputStream s)
          A shortcut method for the method below; automatically spits out HTTP-coded form to the passed stream.
 void writeOut(java.io.DataOutputStream s, boolean HTTPform)
          If HTTPform is true, send a properly structured HTTP response to the output stream, otherwise send a condensed-text form (w/ no headers, just send the "entity" and no tags.)
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

StatusCode

java.lang.String StatusCode

StatusMessage

java.lang.String StatusMessage

HTTPVers

java.lang.String HTTPVers

GeneralHeaders

java.lang.String[] GeneralHeaders

ResponseHeaders

java.lang.String[] ResponseHeaders

EntityHeaders

java.lang.String[] EntityHeaders

GHctr

int GHctr

RHctr

int RHctr

EHctr

int EHctr

mimeType

java.lang.String mimeType

maxBufSize

int maxBufSize

Entity

byte[] Entity

entityPath

java.lang.String entityPath

entityLength

int entityLength

entityFileLength

int entityFileLength

returnCode

int returnCode

uniqueID

static int uniqueID

plugin

NPDocServer plugin

tmpDir

java.lang.String tmpDir
Constructor Detail

HTTPReply

public HTTPReply(NPDocServer pi,
                 java.lang.String tmp)
The HTTP class constructor.

Method Detail

finalize

protected void finalize()
                 throws java.lang.Throwable
Clean up the garbage left over from the transaction.


AddGHeader

public void AddGHeader(java.lang.String field,
                       java.lang.String value)
Add a General header


AddRHeader

public void AddRHeader(java.lang.String field,
                       java.lang.String value)
Add a Response header


AddEHeader

public void AddEHeader(java.lang.String field,
                       java.lang.String value)
Add an Entity header


SetContentType

public void SetContentType(java.lang.String mimeMainType,
                           java.lang.String mimeSubType)
Add a Mime type


SetContentType

public void SetContentType(java.lang.String mime)
Add a Mime type


SetStatCode

public void SetStatCode(java.lang.String error)
Add a Status code


SetErrMessage

public void SetErrMessage(java.lang.String msg)
Add an error message


setEntityLength

public void setEntityLength(int len)
Specify the entity length of the message


getUniqueID

private int getUniqueID()
Get a unique id number.


getNewFileName

private java.lang.String getNewFileName()
Generate a unique file name


setEntity

public void setEntity(java.io.DataInputStream I)
               throws LocalFileStoreException,
                      java.io.IOException
Transfer data from the server to the local directory


getEntityPath

public java.lang.String getEntityPath()
Retrieve a reference to an entity


getEntity

public byte[] getEntity()
                 throws java.io.IOException,
                        NoEntityException
Retrieve the entity itself


getEntityLength

public int getEntityLength()
Get the length of the entity.


setReturnCode

public void setReturnCode(int code)
Set the return code from the server transaction


getReturnCode

public int getReturnCode()
Retrieve the reply return code


getHeader

public java.lang.String getHeader(java.lang.String header)
Parse a header from a string


Add

public void Add(java.lang.String line)
Add a line in the form of a string to the entity body. Tacks on a newline ("\n") after the end.


Add

public void Add(byte[] b,
                int len)
Add bytes to the entity body -- added plain, no modification.


Add

public void Add(byte b)
Add one byte to the entity body


AddHeader

public void AddHeader(java.lang.String line,
                      int level)
Adds a line as an HTML-style header, level "level"


beginHead

public void beginHead()
Begin the message header. look to remove


endHead

public void endHead()
End the message header. look to remove


beginBody

public void beginBody()
Begin the message body. look to remove


endBody

public void endBody()
End the message body. look to remove


AddTitle

public void AddTitle(java.lang.String line)
Add a title to the message. look to remove


AddHTML

public void AddHTML(java.lang.String line)
Add a line of html code to a message. look to remove


writeOut

public void writeOut(java.io.DataOutputStream s)
A shortcut method for the method below; automatically spits out HTTP-coded form to the passed stream.


writeOut

public void writeOut(java.io.DataOutputStream s,
                     boolean HTTPform)
If HTTPform is true, send a properly structured HTTP response to the output stream, otherwise send a condensed-text form (w/ no headers, just send the "entity" and no tags.)