ittp.protocol.response
Class Response.Body

java.lang.Object
  extended byittp.protocol.response.Response.Body
Enclosing class:
Response

public class Response.Body
extends java.lang.Object

This class create the body of the response according to the request of the client.


Field Summary
 java.io.File file
           
 
Constructor Summary
Response.Body(java.io.File file)
          Constructor of the class for the whole of the file.
Response.Body(java.io.File file, int first, int last)
          Constructor of the class for a partial of the file.
Response.Body(Request request)
          Constructor of the class for a trace method.
 
Method Summary
 java.lang.String getDigest()
          Accessors for the value of the content MD5.
 int getFirst()
          Accessors for the number of the first octet of the body.
 int getLast()
          Accessors for the number of the last octet of the body.
 java.lang.String getPathName()
          Accessors for the name of the file (pathName).
 long length()
          Accessors for the length of the body.
 java.io.InputStream toStream()
          Convert to an InputStream the content of the body
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

file

public java.io.File file
Constructor Detail

Response.Body

public Response.Body(java.io.File file)
Constructor of the class for the whole of the file.


Response.Body

public Response.Body(java.io.File file,
                     int first,
                     int last)
Constructor of the class for a partial of the file.


Response.Body

public Response.Body(Request request)
Constructor of the class for a trace method.

Method Detail

getDigest

public java.lang.String getDigest()
Accessors for the value of the content MD5.

Returns:
the String digest containing the content-MD5 of the body.

length

public long length()
Accessors for the length of the body.

Returns:
the length of the body.

getFirst

public int getFirst()
Accessors for the number of the first octet of the body.

Returns:
the int first.

getLast

public int getLast()
Accessors for the number of the last octet of the body.

Returns:
the int last.

getPathName

public java.lang.String getPathName()
Accessors for the name of the file (pathName).

Returns:
the name of the file.

toStream

public java.io.InputStream toStream()
Convert to an InputStream the content of the body

Returns:
an InputStream containing the content of the program.