atg.servlet
Class FileServlet

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.nucleus.TimedOperationService
              extended by atg.nucleus.servlet.ServletService
                  extended by atg.nucleus.servlet.HttpServletService
                      extended by atg.servlet.DynamoServlet
                          extended by atg.servlet.FileServlet
All Implemented Interfaces:
NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, ParameterServlet, java.util.EventListener, javax.servlet.Servlet

public class FileServlet
extends DynamoServlet

A FileServlet handles requests by reading the file specified by "PathTranslated" and sending that file back to the requestor. The content type of the file is determined by a MimeTyper.

A FileCache, if specified, will be used to access files. If a FileCache is not specified, then files will be read directly from the disk.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Fields inherited from class atg.servlet.DynamoServlet
mAllowCleanupRequest, mParameters
 
Fields inherited from class atg.nucleus.servlet.ServletService
SERVLET_INFO_KEY
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
FileServlet()
          Constructs a new blank FileServlet
 
Method Summary
 atg.service.filecache.FileCache getFileCache()
          Returns the FileCache that will be used by this
 atg.servlet.FileEncodingTyper getFileEncodingTyper()
           
 int getFileNotFoundCount()
          Returns the number of files not found by this
 void rawService(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Handles the request by serving the file.
 void service(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Handles the request by serving the file specified by the PathTranslated value.
protected  void serviceInclude(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
           
 void setFileCache(atg.service.filecache.FileCache pFileCache)
          Sets the FileCache that will be used by this
 void setFileEncodingTyper(atg.servlet.FileEncodingTyper pFileEncodingTyper)
           
 
Methods inherited from class atg.servlet.DynamoServlet
doDelete, doGet, doPost, doPut, getParameter, getParameters, getServletContext, service, service, setParameter
 
Methods inherited from class atg.nucleus.servlet.ServletService
destroy, getServletConfig, getServletInfo, init, setServletInfo
 
Methods inherited from class atg.nucleus.TimedOperationService
getAverageRequestHandlingTime, getHandledRequestCount, getRequestStartTime, getTotalRequestHandlingTime, isKeepingStatistics, notifyHandledRequest, resetStatistics, setKeepingStatistics
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string

Constructor Detail

FileServlet

public FileServlet()
Constructs a new blank FileServlet

Method Detail

serviceInclude

protected void serviceInclude(DynamoHttpServletRequest pRequest,
                              DynamoHttpServletResponse pResponse)
                       throws java.io.IOException,
                              javax.servlet.ServletException
Throws:
java.io.IOException
javax.servlet.ServletException

service

public void service(DynamoHttpServletRequest pRequest,
                    DynamoHttpServletResponse pResponse)
             throws java.io.IOException,
                    javax.servlet.ServletException
Handles the request by serving the file specified by the PathTranslated value.

Overrides:
service in class DynamoServlet
Parameters:
pRequest - the request to be processed
pResponse - the response object for this request
Throws:
javax.servlet.ServletException - if an error occurred while processing the servlet request
java.io.IOException - if an error occurred while reading or writing the servlet request

rawService

public void rawService(DynamoHttpServletRequest pRequest,
                       DynamoHttpServletResponse pResponse)
                throws java.io.IOException,
                       javax.servlet.ServletException
Handles the request by serving the file.

Unlike service() rawService() does not set the content type, content length or last modified headers. You can use this method to serve the file programmatically after the headers for the response have already been sent.

Throws:
javax.servlet.ServletException - if an error occurred while processing the servlet request
java.io.IOException - if an error occurred while reading or writing the servlet request

setFileCache

public void setFileCache(atg.service.filecache.FileCache pFileCache)
Sets the FileCache that will be used by this


getFileCache

public atg.service.filecache.FileCache getFileCache()
Returns the FileCache that will be used by this


setFileEncodingTyper

public void setFileEncodingTyper(atg.servlet.FileEncodingTyper pFileEncodingTyper)

getFileEncodingTyper

public atg.servlet.FileEncodingTyper getFileEncodingTyper()

getFileNotFoundCount

public int getFileNotFoundCount()
Returns the number of files not found by this