org.apache.cocoon.environment.commandline
Class AbstractCommandLineEnvironment

java.lang.Object
  |
  +--org.apache.avalon.framework.logger.AbstractLoggable
        |
        +--org.apache.cocoon.environment.AbstractEnvironment
              |
              +--org.apache.cocoon.environment.commandline.AbstractCommandLineEnvironment
All Implemented Interfaces:
Environment, org.apache.avalon.framework.logger.Loggable, Redirector, SourceResolver
Direct Known Subclasses:
FileSavingEnvironment, LinkSamplingEnvironment

public abstract class AbstractCommandLineEnvironment
extends AbstractEnvironment
implements Redirector

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

Version:
CVS $Id: AbstractCommandLineEnvironment.java,v 1.7 2002/03/27 15:13:40 sylvain Exp $
Author:
Stefano Mazzocchi

Field Summary
protected  int contentLength
           
protected  java.lang.String contentType
           
protected  boolean hasRedirected
           
protected  java.io.OutputStream stream
           
 
Fields inherited from class org.apache.cocoon.environment.AbstractEnvironment
action, context, manager, objectModel, prefix, rootContext, sourceHandler, uris, view
 
Constructor Summary
AbstractCommandLineEnvironment(java.lang.String uri, java.lang.String view, java.io.File context, java.io.OutputStream stream, org.apache.log.Logger log)
           
 
Method Summary
 java.lang.String getContentType()
          Get the ContentType
 java.io.OutputStream getOutputStream()
          Get the OutputStream
 boolean hasRedirected()
          Was one of the redirection methods called ?
 void redirect(boolean sessionmode, java.lang.String newURL)
          Redirect the client to a new URL
 void setContentLength(int contentLength)
          Set the ContentLength
 void setContentType(java.lang.String contentType)
          Set the ContentType
 
Methods inherited from class org.apache.cocoon.environment.AbstractEnvironment
changeContext, getAction, getAttribute, getAttributeNames, getComponentManager, getContext, getObjectModel, getRootContext, getSourceHandler, getURI, getURIPrefix, getView, globalRedirect, isResponseModified, removeAttribute, resolve, setAttribute, setComponentManager, setContext, setContext, setResponseIsNotModified, setSourceHandler, setStatus, setURIPrefix, tryResetResponse
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLoggable
getLogger, setLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.cocoon.environment.Redirector
globalRedirect
 

Field Detail

contentType

protected java.lang.String contentType

stream

protected java.io.OutputStream stream

contentLength

protected int contentLength

hasRedirected

protected boolean hasRedirected
Constructor Detail

AbstractCommandLineEnvironment

public AbstractCommandLineEnvironment(java.lang.String uri,
                                      java.lang.String view,
                                      java.io.File context,
                                      java.io.OutputStream stream,
                                      org.apache.log.Logger log)
                               throws java.net.MalformedURLException
Method Detail

redirect

public void redirect(boolean sessionmode,
                     java.lang.String newURL)
              throws java.io.IOException
Redirect the client to a new URL
Specified by:
redirect in interface Redirector
Overrides:
redirect in class AbstractEnvironment

hasRedirected

public boolean hasRedirected()
Description copied from interface: Redirector
Was one of the redirection methods called ?
Specified by:
hasRedirected in interface Redirector

setContentType

public void setContentType(java.lang.String contentType)
Set the ContentType

setContentLength

public void setContentLength(int contentLength)
Set the ContentLength

getContentType

public java.lang.String getContentType()
Get the ContentType

getOutputStream

public java.io.OutputStream getOutputStream()
                                     throws java.io.IOException
Get the OutputStream


Copyright � 1999-2002 Apache Software Foundation. All Rights Reserved.