|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.alltimeflashdreamer.filelister.FileListerFactory
Title: FileListerFactory
Description: This class is designed to be used by the various JSP sites, to avoid having too much code within those sites. The public methods serve the JSP sites directly, using a simple, static, one-line call.
Organization: All Time Flash Dreamer
Constructor Summary | |
FileListerFactory()
|
Method Summary | |
static FileListerConfig |
getFileListerConfig(HttpServletRequest request)
Gets the instance of FileListerConfig that is specified by the URL parameter "window" from the session's attribute list. |
static void |
handleFileListerException(HttpServletResponse response,
FileListerConfig fileListerConfig,
FileListerException fle)
If the given FileListerConfig isn't null, the catched exception is stored therein and the client is redirected to the error site, else the exception itself is throw again. |
static FileListerConfig |
initialize(HttpServletRequest request,
HttpServletResponse response,
ServletContext context)
Does the jobs to be done before the result site's frame content sites can show the results/configuration appropriately: - reads the configuration file - verifies that the connection pool is initialized - verifies that a FileListerConfig instance is initialized and stored within the session, together with a unique window id (which is stored in the new FileListerConfig instance) - return the new instance for immediate work |
static void |
printRequestParameters(HttpServletRequest request)
Prints out all the parameter key/value pairs to the standard out. |
static void |
processSearch(HttpServletRequest request,
HttpServletResponse response)
Processes the task of executing a search within the index or the file system by reading the URL parameters and reacting according to them. |
static void |
redirectToAppRoot(HttpServletResponse response)
Returns the client to the application root in one of the many possible cases |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public FileListerFactory()
Method Detail |
public static FileListerConfig initialize(HttpServletRequest request, HttpServletResponse response, ServletContext context) throws FileListerException, IOException
request
- the request of the "JSP servlet"response
- the response of the "JSP servlet"context
- the servlet context of the "JSP servlet"
FileListerException
- thrown only if the FileListerConfig wasn't stored
in the user's session
IOException
- if the redirect to the error site somehow failedpublic static void processSearch(HttpServletRequest request, HttpServletResponse response) throws FileListerException, IOException
request
- the request of the "JSP servlet"response
- the response of the "JSP servlet"
FileListerException
- if the processing of the URL input or the search
itself threw an exception which couldn't be shown to the client
IOException
- if the redirect to the error site somehow failedpublic static void handleFileListerException(HttpServletResponse response, FileListerConfig fileListerConfig, FileListerException fle) throws FileListerException, IOException
response
- the response to redirect the client tofileListerConfig
- the magic config object, ready to take the given
exceptionfle
- the exception to handle
FileListerException
- the given exception, in case the FileListerConfig
is null
IOException
- in case the redirection failed somehowpublic static FileListerConfig getFileListerConfig(HttpServletRequest request)
request
- the request to get an attribute of
public static void redirectToAppRoot(HttpServletResponse response) throws IOException
response
-
IOException
public static void printRequestParameters(HttpServletRequest request)
request
- the request to read the parameters from
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |