Esri Geoportal Server
1.0

com.esri.gpt.framework.http
Class ResponseInfo

java.lang.Object
  extended by com.esri.gpt.framework.http.ResponseInfo

public class ResponseInfo
extends Object

Contains basic information about an HTTP response.


Constructor Summary
ResponseInfo()
          Default constructor.
 
Method Summary
 long getBytesRead()
          Gets the actual number of bytes read from the HTTP response body.
 long getCharactersRead()
          Gets the actual number of characters read from the HTTP response body.
 String getContentEncoding()
          Gets the character encoding associated with the HTTP response body.
 long getContentLength()
          Gets the declared length associated with the HTTP response body.
 String getContentType()
          Gets the content type (i.e.
 String getDefaultEncoding()
          Gets the default character encoding for an HTTP response.
 int getResponseCode()
          Gets the code associated with the HTTP response.
 String getResponseMessage()
          Gets the status message (or "reason phrase") associated with the HTTP response.
 void reset()
          Resets response information.
 void setBytesRead(long length)
          Sets the actual number of bytes read from the HTTP response body.
 void setCharactersRead(long length)
          Sets the actual number of characters read from the HTTP response body.
 void setContentEncoding(String encoding)
          Sets the character encoding associated with the HTTP response body.
 void setContentLength(long length)
          Sets the declared length associated with the HTTP response body.
 void setContentType(String contentType)
          Sets the content type (i.e.
 void setDefaultEncoding(String encoding)
          Sets the default character encoding for an HTTP response.
 void setResponseCode(int code)
          Sets the code associated with the HTTP response.
 void setResponseMessage(String message)
          Sets the status message (or "reason phrase") associated with the HTTP response.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResponseInfo

public ResponseInfo()
Default constructor.

Method Detail

getBytesRead

public long getBytesRead()
Gets the actual number of bytes read from the HTTP response body.

Returns:
the number of bytes read (-1 if unknown)

setBytesRead

public void setBytesRead(long length)
Sets the actual number of bytes read from the HTTP response body.

Parameters:
length - the number of bytes read (-1 if unknown)

getCharactersRead

public long getCharactersRead()
Gets the actual number of characters read from the HTTP response body.

Returns:
the number of characters read (-1 if unknown)

setCharactersRead

public void setCharactersRead(long length)
Sets the actual number of characters read from the HTTP response body.

Parameters:
length - the number of characters read (-1 if unknown)

getContentEncoding

public String getContentEncoding()
Gets the character encoding associated with the HTTP response body.

Returns:
the encoding of the response body (if known)

setContentEncoding

public void setContentEncoding(String encoding)
Sets the character encoding associated with the HTTP response body.

Parameters:
encoding - the encoding of the response body (if known)

getContentLength

public long getContentLength()
Gets the declared length associated with the HTTP response body.

Returns:
the declared length of the response body (-1 if unknown)

setContentLength

public void setContentLength(long length)
Sets the declared length associated with the HTTP response body.

Parameters:
length - the declared length of the response body (-1 if unknown)

getContentType

public String getContentType()
Gets the content type (i.e. MIME type) associated with the HTTP response body.

Returns:
the content type of the response body (if known)

setContentType

public void setContentType(String contentType)
Sets the content type (i.e. MIME type) associated with the HTTP response body.

Parameters:
contentType - the content type of the response body (if known)

getDefaultEncoding

public String getDefaultEncoding()
Gets the default character encoding for an HTTP response.
The default is used for character responses that do not specify an encoding.

Returns:
the default encoding for a response body

setDefaultEncoding

public void setDefaultEncoding(String encoding)
Sets the default character encoding for an HTTP response.
The default is used for character responses that do not specify an encoding.

Parameters:
encoding - the default encoding for a response body

getResponseCode

public int getResponseCode()
Gets the code associated with the HTTP response.

Returns:
the HTTP response code

setResponseCode

public void setResponseCode(int code)
Sets the code associated with the HTTP response.

Parameters:
code - the HTTP response code

getResponseMessage

public String getResponseMessage()
Gets the status message (or "reason phrase") associated with the HTTP response.

Returns:
the HTTP response message

setResponseMessage

public void setResponseMessage(String message)
Sets the status message (or "reason phrase") associated with the HTTP response.

Parameters:
message - the HTTP response message

reset

public void reset()
Resets response information.


Esri Geoportal Server
1.0

Copyright 2011 Environmental Systems Research Institute. All rights reserved. Use is subject to license terms.