org.apache.cocoon.environment.commandline
Class FileSavingEnvironment

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

public class FileSavingEnvironment
extends AbstractCommandLineEnvironment

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

Version:
CVS $Id: FileSavingEnvironment.java 30941 2004-07-29 19:56:58Z vgritsenko $
Author:
Stefano Mazzocchi, Upayavira

Field Summary
protected  boolean modified
           
protected  long sourceLastModified
           
 
Fields inherited from class org.apache.cocoon.environment.commandline.AbstractCommandLineEnvironment
contentLength, contentType, statusCode
 
Fields inherited from class org.apache.cocoon.environment.AbstractEnvironment
action, objectModel, outputStream, prefix, secureOutputStream, uri, view
 
Constructor Summary
FileSavingEnvironment(String uri, File context, Map attributes, Map parameters, Map links, List gatheredLinks, CommandLineContext cliContext, OutputStream stream, Logger log)
           
FileSavingEnvironment(String uri, long lastModified, File context, Map attributes, Map parameters, Map links, List gatheredLinks, CommandLineContext cliContext, OutputStream stream, Logger log)
           
 
Method Summary
 boolean isModified()
           
 boolean isResponseModified(long cacheLastModified)
          Check if the response has been modified since the same "resource" was requested.
 void setResponseIsNotModified()
          Mark the response as not modified.
 
Methods inherited from class org.apache.cocoon.environment.commandline.AbstractCommandLineEnvironment
getContentType, getOutputStream, getStatus, isExternal, redirect, setContentLength, setContentType, setStatus
 
Methods inherited from class org.apache.cocoon.environment.AbstractEnvironment
commitResponse, extractAction, extractView, finishingProcessing, getAction, getAttribute, getAttributeNames, getObjectModel, getURI, getURIPrefix, getView, isInternalRedirect, removeAttribute, setAction, setAttribute, 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

modified

protected boolean modified

sourceLastModified

protected long sourceLastModified
Constructor Detail

FileSavingEnvironment

public FileSavingEnvironment(String uri,
                             long lastModified,
                             File context,
                             Map attributes,
                             Map parameters,
                             Map links,
                             List gatheredLinks,
                             CommandLineContext cliContext,
                             OutputStream stream,
                             Logger log)
                      throws MalformedURLException

FileSavingEnvironment

public FileSavingEnvironment(String uri,
                             File context,
                             Map attributes,
                             Map parameters,
                             Map links,
                             List gatheredLinks,
                             CommandLineContext cliContext,
                             OutputStream stream,
                             Logger log)
                      throws MalformedURLException
Method Detail

isResponseModified

public boolean isResponseModified(long cacheLastModified)
Check if the response has been modified since the same "resource" was requested. The caller has to test if it is really the same "resource" which is requested.

Specified by:
isResponseModified in interface Environment
Overrides:
isResponseModified in class AbstractEnvironment
Returns:
true if the response is modified or if the environment is not able to test it

setResponseIsNotModified

public void setResponseIsNotModified()
Mark the response as not modified.

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

isModified

public boolean isModified()


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