org.apache.cocoon.environment.commandline
Class AbstractCommandLineEnvironment

java.lang.Object
  extended byorg.apache.avalon.framework.logger.AbstractLogEnabled
      extended byorg.apache.cocoon.environment.AbstractEnvironment
          extended byorg.apache.cocoon.environment.commandline.AbstractCommandLineEnvironment
All Implemented Interfaces:
Environment, LogEnabled
Direct Known Subclasses:
DelayedFileSavingEnvironment, FileSavingEnvironment, LinkSamplingEnvironment

public abstract class AbstractCommandLineEnvironment
extends AbstractEnvironment

This environment is used to save the requested file to disk.

Version:
CVS $Id: AbstractCommandLineEnvironment.java 165284 2005-04-29 09:24:28Z cziegeler $
Author:
Stefano Mazzocchi

Field Summary
protected  int contentLength
           
protected  String contentType
           
protected  int statusCode
           
 
Fields inherited from class org.apache.cocoon.environment.AbstractEnvironment
action, objectModel, outputStream, prefix, secureOutputStream, uri, view
 
Constructor Summary
AbstractCommandLineEnvironment(String uri, String view, File context, OutputStream stream, Logger log)
           
 
Method Summary
 String getContentType()
          Get the ContentType
 OutputStream getOutputStream(int bufferSize)
          Return an OutputStream, but allow it to be null for when the pipeline is being streamed to the provided SAX content handler (using CocoonBean)
 int getStatus()
          Get the StatusCode
 boolean isExternal()
          Always return true.
 void redirect(String newURL, boolean global, boolean permanent)
          Redirect the client to a new URL
 void setContentLength(int contentLength)
          Set the ContentLength
 void setContentType(String contentType)
          Set the ContentType
 void setStatus(int statusCode)
          Set the StatusCode
 
Methods inherited from class org.apache.cocoon.environment.AbstractEnvironment
commitResponse, extractAction, extractView, finishingProcessing, getAction, getAttribute, getAttributeNames, getObjectModel, getURI, getURIPrefix, getView, isInternalRedirect, isResponseModified, removeAttribute, setAction, setAttribute, setResponseIsNotModified, setURI, setView, startingProcessing, tryResetResponse
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

contentType

protected String contentType

contentLength

protected int contentLength

statusCode

protected int statusCode
Constructor Detail

AbstractCommandLineEnvironment

public AbstractCommandLineEnvironment(String uri,
                                      String view,
                                      File context,
                                      OutputStream stream,
                                      Logger log)
                               throws MalformedURLException
Method Detail

redirect

public void redirect(String newURL,
                     boolean global,
                     boolean permanent)
              throws IOException
Redirect the client to a new URL

Throws:
IOException

setStatus

public void setStatus(int statusCode)
Set the StatusCode

Specified by:
setStatus in interface Environment
Overrides:
setStatus in class AbstractEnvironment

getStatus

public int getStatus()
Get the StatusCode


setContentType

public void setContentType(String contentType)
Set the ContentType


setContentLength

public void setContentLength(int contentLength)
Set the ContentLength


getContentType

public String getContentType()
Get the ContentType


isExternal

public boolean isExternal()
Always return true.

Returns:
true if this environment is external

getOutputStream

public OutputStream getOutputStream(int bufferSize)
                             throws IOException
Return an OutputStream, but allow it to be null for when the pipeline is being streamed to the provided SAX content handler (using CocoonBean)

Specified by:
getOutputStream in interface Environment
Overrides:
getOutputStream in class AbstractEnvironment
Throws:
IOException


Copyright ? 1999-2005 The Apache Software Foundation. All Rights Reserved.