|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.nucleus.logging.VariableArgumentApplicationLoggingImpl atg.nucleus.GenericService atg.nucleus.TimedOperationService atg.servlet.pipeline.PipelineableServletImpl atg.servlet.pipeline.FileFinderPipelineServlet
public class FileFinderPipelineServlet
This pipeline servlet will set the pathTranslated by appending the pathInfo to the document root (set as a property). If the pathInfo maps to a directory, then this will attempt to find an index file in that directory as specified by the "indexFiles" property, which lists the index files to try to find in order. If the pathTranslated is modified, then pathInfo and requestURI is also modified to keep the requestURI=contextPath+servletPath+pathInfo+queryArgs equation true.
If none of the index files are found for a directory reference, and "shouldListDirectory" is true, then the directory listing will be returned as the result of the request and the request will not be passed on.
If the pathInfo cannot map to any file or directory listing, then a 404 error is returned and the request is not passed on.
If the pathInfo maps to a directory but does not end with a "/", then a redirect is issued with the "/" and the request is not passed on.
If the pathTranslated is already set (is non-null), then all of the above functionality is skipped.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
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 | |
---|---|
FileFinderPipelineServlet()
Constructs a new FileFinderPipelineServlet |
Method Summary | |
---|---|
void |
doStartService()
This is called after a Service has been created, placed into the naming hierarchy, and initialized with its configured property values. |
int |
getDirectoryListingsServedCount()
Returns the number of directory listings served by this |
java.lang.String |
getDocRootServicePrefix()
Returns the property that specifies the path to find services in the nucleus component hierarchy that are in the doc root. |
java.io.File |
getDocumentRoot()
Returns the first entry in the document root path. |
java.io.File[] |
getDocumentRootPath()
Returns the document root from which path references will be resolved. |
java.lang.String |
getErrorURL()
Returns the value of the property ErrorURL. |
atg.service.filecache.FileAttributesCache |
getFileAttributesCache()
Return the file attributes cache |
int |
getFileNotFoundCount()
Returns the number of files not found by this |
java.lang.String[] |
getIndexFiles()
Returns the list of files to be searched in order when a request is sent referring to a directory. |
int |
getIndexFilesServedCount()
Returns the number of index files served by this |
boolean |
getProcessIndexFiles()
Returns the flag that indicates whether we should we try to process index files on already translated paths. |
java.lang.String |
getRealPath(DynamoHttpServletRequest pRequest,
java.lang.String pPathInfo)
This implements the PathTranslator method. |
boolean |
getReportFileNotFound()
Gets the flag that tells whether or not we report file not found errors. |
boolean |
getShouldListDirectory()
Returns the flag indicating whether a directory should be listed in response to a directory reference in which no index files can be found. |
java.util.Properties |
getVirtualDirectoryMap()
Gets the virtual directory map. |
boolean |
isAlwaysTranslate()
Returns the flag indicating if this should always translate files, even if the request comes in with a pathTranslated. |
void |
service(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Services a DynamoHttpServletRequest/Response pair |
void |
setAlwaysTranslate(boolean pAlwaysTranslate)
Sets the flag indicating if this should always translate files, even if the request comes in with a pathTranslated. |
void |
setDocRootServicePrefix(java.lang.String pDocRootServicePrefix)
Sets the property that specifies the path to find services in the nucleus component hierarchy that are in the doc root. |
void |
setDocumentRoot(java.io.File pDocumentRoot)
For convenience, users can also set the DocumentRoot property as a single file if documentRootPath has not already been set. |
void |
setDocumentRootPath(java.io.File[] pDocumentRootPath)
Sets the document root from which path references will be resolved. |
void |
setErrorURL(java.lang.String pErrorURL)
Sets the property ErrorURL. |
void |
setFileAttributesCache(atg.service.filecache.FileAttributesCache pFileAttributesCache)
Set the file attributes cache |
void |
setIndexFiles(java.lang.String[] pIndexFiles)
Sets the list of files to be searched in order when a request is sent referring to a directory. |
void |
setProcessIndexFiles(boolean pProcessIndexFiles)
Should we try to process index files on already translated paths? This option should be used for servers that translate the paths, but do not do index file translating (such as the Java Web Server). |
void |
setReportFileNotFound(boolean pReportFileNotFound)
Should we report file not found errors? |
void |
setShouldListDirectory(boolean pShouldListDirectory)
Sets the flag indicating whether a directory should be listed in response to a directory reference in which no index files can be found. |
void |
setVirtualDirectoryMap(java.util.Properties pMap)
Sets the virtual directory map. |
Methods inherited from class atg.servlet.pipeline.PipelineableServletImpl |
---|
createAdminServlet, destroy, getAdminServlet, getNextServlet, getServletConfig, getServletInfo, init, isUsePathInfo, passRequest, passRequest, service, service, setNextServlet, setServletInfo, setUsePathInfo |
Methods inherited from class atg.nucleus.TimedOperationService |
---|
getAverageRequestHandlingTime, getHandledRequestCount, getRequestStartTime, getTotalRequestHandlingTime, isKeepingStatistics, notifyHandledRequest, resetStatistics, setKeepingStatistics |
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 |
---|
public static java.lang.String CLASS_VERSION
Constructor Detail |
---|
public FileFinderPipelineServlet()
Method Detail |
---|
public void setVirtualDirectoryMap(java.util.Properties pMap)
public java.util.Properties getVirtualDirectoryMap()
public void setDocumentRootPath(java.io.File[] pDocumentRootPath)
public java.io.File[] getDocumentRootPath()
public void setDocumentRoot(java.io.File pDocumentRoot)
public java.io.File getDocumentRoot()
public void setIndexFiles(java.lang.String[] pIndexFiles)
public java.lang.String[] getIndexFiles()
public void setShouldListDirectory(boolean pShouldListDirectory)
public boolean getShouldListDirectory()
public void setReportFileNotFound(boolean pReportFileNotFound)
public boolean getReportFileNotFound()
public void setErrorURL(java.lang.String pErrorURL)
pErrorURL
- new Error URLpublic java.lang.String getErrorURL()
public boolean isAlwaysTranslate()
public void setAlwaysTranslate(boolean pAlwaysTranslate)
public void setProcessIndexFiles(boolean pProcessIndexFiles)
public boolean getProcessIndexFiles()
public java.lang.String getDocRootServicePrefix()
public void setDocRootServicePrefix(java.lang.String pDocRootServicePrefix)
public int getFileNotFoundCount()
public int getIndexFilesServedCount()
public int getDirectoryListingsServedCount()
public void setFileAttributesCache(atg.service.filecache.FileAttributesCache pFileAttributesCache)
public atg.service.filecache.FileAttributesCache getFileAttributesCache()
public void doStartService() throws ServiceException
GenericService
doStartService
in class GenericService
ServiceException
- if the Service had a problem starting uppublic void service(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws java.io.IOException, javax.servlet.ServletException
service
in class PipelineableServletImpl
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 requestpublic java.lang.String getRealPath(DynamoHttpServletRequest pRequest, java.lang.String pPathInfo)
getRealPath
in interface PathTranslator
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |