org.apache.cocoon.environment.commandline
Class FileSavingEnvironment

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

public class FileSavingEnvironment
extends AbstractCommandLineEnvironment

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

Version:
$Id: FileSavingEnvironment.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Stefano Mazzocchi, Upayavira

Field Summary
protected  boolean modified
           
protected  long sourceLastModified
           
 
Fields inherited from class org.apache.cocoon.environment.commandline.AbstractCommandLineEnvironment
CLI_REQUEST_ID, contentLength, contentType, hasRedirected, statusCode
 
Fields inherited from class org.apache.cocoon.environment.AbstractEnvironment
action, avalonToCocoonSourceWrapper, context, initializedComponents, manager, objectModel, outputStream, prefix, rootContext, secureOutputStream, sourceResolver, uris, view
 
Fields inherited from interface org.apache.excalibur.source.SourceResolver
METHOD, ROLE, URI_ENCODING, URI_PARAMETERS
 
Constructor Summary
FileSavingEnvironment(String uri, File context, Map attributes, Map parameters, Map headers, Map links, List gatheredLinks, CommandLineContext cliContext, OutputStream stream, Logger log)
           
FileSavingEnvironment(String uri, long lastModified, File context, Map attributes, Map parameters, Map headers, 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, hasRedirected, isExternal, redirect, sendStatus, setContentLength, setContentType, setStatus
 
Methods inherited from class org.apache.cocoon.environment.AbstractEnvironment
changeContext, commitResponse, extractAction, extractView, finishingProcessing, getAction, getAttribute, getAttributeNames, getContext, getObjectModel, getOutputStream, getRootContext, getURI, getURIPrefix, getView, globalRedirect, hasAttribute, initComponents, isInternalRedirect, release, removeAttribute, resolve, resolveURI, resolveURI, setAction, setAttribute, setContext, setContext, setURIPrefix, 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
 
Methods inherited from interface org.apache.cocoon.environment.Redirector
globalRedirect
 

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 headers,
                             Map links,
                             List gatheredLinks,
                             CommandLineContext cliContext,
                             OutputStream stream,
                             Logger log)
                      throws MalformedURLException
Throws:
MalformedURLException

FileSavingEnvironment

public FileSavingEnvironment(String uri,
                             File context,
                             Map attributes,
                             Map parameters,
                             Map headers,
                             Map links,
                             List gatheredLinks,
                             CommandLineContext cliContext,
                             OutputStream stream,
                             Logger log)
                      throws MalformedURLException
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-2010 The Apache Software Foundation. All Rights Reserved.