com.opencms.core
Class CmsExportResponse

java.lang.Object
  |
  +--com.opencms.core.CmsExportResponse
All Implemented Interfaces:
I_CmsResponse

public class CmsExportResponse
extends Object
implements I_CmsResponse

Implementation of the I_CmsResponse interface which is used as response buffer for pages during a static export.

Version:
$Revision: 1.2 $ $Date: 2002/10/30 10:07:28 $

Constructor Summary
CmsExportResponse()
           
 
Method Summary
 void addHeader(String key, String value)
          Add a header-field in the response.
 boolean containsHeader(String key)
          Checks, if the header was set already.
 String getContentType()
          Returns the content type of the response which has previously been set using setContentType(java.lang.String).
 Object getOriginalResponse()
          Returns the original response that was used to create the CmsResponse.
 int getOriginalResponseType()
          Returns the type of the response that was used to create the CmsResponse.
 OutputStream getOutputStream()
          Returns an OutputStream for writing the response data.
 boolean isOutputWritten()
          Check if the output stream was requested previously.
 boolean isRedirected()
          Check if the current request was redirected.
 void putOutputStream(OutputStream outStream)
           
 void sendCmsRedirect(String location)
          Sets a redirect to send the responst to.
 void sendError(int code)
          Sets the error code that is returnd by the response.
 void sendError(int code, String msg)
          Sets the error code and a additional message that is returnd by the response.
 void sendRedirect(String location)
          Helper function for a redirect to the cluster url.
 void setContentLength(int len)
          Sets the length of the content being returned by the server.
 void setContentType(String type)
          Sets the content type of the response to the specified type.
 void setHeader(String key, String value)
          Sets a header-field in the response.
 void setLastModified(long time)
          Sets the last modified header-field in the response.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CmsExportResponse

public CmsExportResponse()
Method Detail

getOriginalResponse

public Object getOriginalResponse()
Description copied from interface: I_CmsResponse
Returns the original response that was used to create the CmsResponse.

Specified by:
getOriginalResponse in interface I_CmsResponse
Returns:
The original response of the CmsResponse.

getOriginalResponseType

public int getOriginalResponseType()
Description copied from interface: I_CmsResponse
Returns the type of the response that was used to create the CmsResponse. The returned int must be one of the constants defined above in this interface.

Specified by:
getOriginalResponseType in interface I_CmsResponse
Returns:
The type of the CmsResponse.

putOutputStream

public void putOutputStream(OutputStream outStream)

getOutputStream

public OutputStream getOutputStream()
                             throws IOException
Description copied from interface: I_CmsResponse
Returns an OutputStream for writing the response data.

Specified by:
getOutputStream in interface I_CmsResponse
Returns:
OutputStream for writing data.
IOException

isOutputWritten

public boolean isOutputWritten()
Check if the output stream was requested previously.

Specified by:
isOutputWritten in interface I_CmsResponse
Returns:
true if getOutputStream() was called, false otherwise.

isRedirected

public boolean isRedirected()
Description copied from interface: I_CmsResponse
Check if the current request was redirected. In this case, the servlet must not write any bytes to the output stream.

Specified by:
isRedirected in interface I_CmsResponse
Returns:
true if the request is redirected, false otherwise.

sendCmsRedirect

public void sendCmsRedirect(String location)
                     throws IOException
Description copied from interface: I_CmsResponse
Sets a redirect to send the responst to.

Specified by:
sendCmsRedirect in interface I_CmsResponse
Parameters:
location - The location the response is send to.
IOException

sendError

public void sendError(int code)
               throws IOException
Description copied from interface: I_CmsResponse
Sets the error code that is returnd by the response. The error code is specified by a numeric value.

Specified by:
sendError in interface I_CmsResponse
Parameters:
code - The error code to be set.
IOException

sendError

public void sendError(int code,
                      String msg)
               throws IOException
Description copied from interface: I_CmsResponse
Sets the error code and a additional message that is returnd by the response. The error code is specified by a numeric value.

Specified by:
sendError in interface I_CmsResponse
Parameters:
code - The error code to be set.
msg - Additional error message.
IOException

sendRedirect

public void sendRedirect(String location)
                  throws IOException
Description copied from interface: I_CmsResponse
Helper function for a redirect to the cluster url.

Specified by:
sendRedirect in interface I_CmsResponse
Parameters:
location - a complete url, eg. http://servername/servlets/opencms/index.html
IOException

setContentLength

public void setContentLength(int len)
Description copied from interface: I_CmsResponse
Sets the length of the content being returned by the server.

Specified by:
setContentLength in interface I_CmsResponse
Parameters:
len - Number of bytes to be returned by the response.

setContentType

public void setContentType(String type)
Description copied from interface: I_CmsResponse
Sets the content type of the response to the specified type.

Specified by:
setContentType in interface I_CmsResponse
Parameters:
type - The contnent type of the response.

getContentType

public String getContentType()
Description copied from interface: I_CmsResponse
Returns the content type of the response which has previously been set using I_CmsResponse.setContentType(java.lang.String).

Specified by:
getContentType in interface I_CmsResponse
Returns:
the content type of the response.

setHeader

public void setHeader(String key,
                      String value)
Description copied from interface: I_CmsResponse
Sets a header-field in the response.

Specified by:
setHeader in interface I_CmsResponse
Parameters:
key - The key for the header.
value - The value for the header.

addHeader

public void addHeader(String key,
                      String value)
Description copied from interface: I_CmsResponse
Add a header-field in the response.

Specified by:
addHeader in interface I_CmsResponse
Parameters:
key - The key for the header.
value - The value for the header.

setLastModified

public void setLastModified(long time)
Description copied from interface: I_CmsResponse
Sets the last modified header-field in the response.

Specified by:
setLastModified in interface I_CmsResponse
Parameters:
time - The last-modified time.

containsHeader

public boolean containsHeader(String key)
Description copied from interface: I_CmsResponse
Checks, if the header was set already.

Specified by:
containsHeader in interface I_CmsResponse
Returns:
true, if the header was set before else false.