DJDoc v.1.0.0b-1

net.sf.djdoc.action
Class FileAction

java.lang.Object
  extended by net.sf.djdoc.action.FileAction
All Implemented Interfaces:
Action

public class FileAction
extends java.lang.Object
implements Action

The FileAction is an implementation of the Action interface which simply copies the content of a file into the response.


Constructor Summary
FileAction()
           
 
Method Summary
 java.lang.Object perform(DjdocRequest req)
          This method identifies the file to be sent back by the request path and returns a File object for it.
 void sendResponse(DjdocRequest req, javax.servlet.http.HttpServletResponse res)
          This method directly copies the content of the file returned by the method perform(DjdocRequest) into the HTTP response output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileAction

public FileAction()
Method Detail

perform

public java.lang.Object perform(DjdocRequest req)
This method identifies the file to be sent back by the request path and returns a File object for it. No exception is thrown if the file does not exist.

Specified by:
perform in interface Action
Parameters:
req - The wrapper around the HTTP request
Returns:
The File object to be copied into the response

sendResponse

public void sendResponse(DjdocRequest req,
                         javax.servlet.http.HttpServletResponse res)
                  throws java.io.IOException
This method directly copies the content of the file returned by the method perform(DjdocRequest) into the HTTP response output stream.

Specified by:
sendResponse in interface Action
Parameters:
req - The wrapper around the HTTP request
res - The HTTP response connected to the server call
Throws:
java.io.IOException - If the specified file is not found, an IOException is thrown.

DJDoc v.1.0.0b-1