| com.jcorporate.expresso.core.controller.DBController com.jcorporate.expresso.ext.controller.Download
Method Summary | |
protected void | checkIsAllowed(ControllerRequest request, User u, DownloadFiles file) Checks file permissions and throws an Exception, and logs an event
if the user does not have permission to run. | protected String | getDownloadTime(ControllerResponse response, long fileLength) Returns a string estimating download time at 28.8k
This function assumes a download rate of 5 Mb / minute
Parameters: response - The controller response object to get the requestinguser's Locale. Parameters: fileLength - The length of the file to calculate. | protected String | getFriendlyName(DownloadFiles oneDownloadFile) | protected DownloadFiles | getThisDownloadFile(ControllerRequest request, User u) | public String | getTitle() | protected boolean | isAllowed(ControllerRequest request, DownloadFiles oneFile, User myUser) Is it allowed for this user to download this particular file?
Parameters: request - The Controller Request object passed to the controller state handler Parameters: oneFile - The download file definition Parameters: myUser - The user making the controller request. | protected void | logInvalidFileRequest(ControllerRequest request, User myUser) Sets off the system event for an invalid file number requested. | protected void | returnFile(String filename, OutputStream out) | protected ControllerResponse | runBeginState(ControllerRequest request, ControllerResponse response) Starts a download for a file. | protected ControllerResponse | runDownloadState(ControllerRequest controllerRequest, ControllerResponse controllerResponse) Returns the file actually requested by the user. | protected ControllerResponse | runListState(ControllerRequest request, ControllerResponse response) Lists the files available for download. | protected void | runViewNotesState(ControllerRequest request, ControllerResponse response) View the notes associated with the download. |
Download | public Download()(Code) | | |
checkIsAllowed | protected void checkIsAllowed(ControllerRequest request, User u, DownloadFiles file) throws ControllerException(Code) | | Checks file permissions and throws an Exception, and logs an event
if the user does not have permission to run.
Parameters: request - the ControllerRequest object Parameters: u - the user requesting the file Parameters: file - the file to download throws: ControllerException - if the file is not allowed for the givenuser. |
getDownloadTime | protected String getDownloadTime(ControllerResponse response, long fileLength) throws ControllerException(Code) | | Returns a string estimating download time at 28.8k
This function assumes a download rate of 5 Mb / minute
Parameters: response - The controller response object to get the requestinguser's Locale. Parameters: fileLength - The length of the file to calculate. java.lang.String estimating the download time at 28.8k throws: ControllerException - if the download time is unable to get theinternationalized strings for Minutes and Seconds. |
getThisDownloadFile | protected DownloadFiles getThisDownloadFile(ControllerRequest request, User u) throws ControllerException(Code) | | Convenience method to retrieve the download file based upon the file
parameter
Parameters: request - The ControllerRequest object Parameters: u - the User requesting the DownloadFile DataObject representing the file parameterrequested. throws: ControllerException - upon illegal inputs |
getTitle | public String getTitle()(Code) | | Returns title of this controller
java.lang.String The Title of the controller |
isAllowed | protected boolean isAllowed(ControllerRequest request, DownloadFiles oneFile, User myUser) throws DBException(Code) | | Is it allowed for this user to download this particular file?
Parameters: request - The Controller Request object passed to the controller state handler Parameters: oneFile - The download file definition Parameters: myUser - The user making the controller request. true if the file is allowed throws: DBException - upon database access error |
logInvalidFileRequest | protected void logInvalidFileRequest(ControllerRequest request, User myUser) throws ControllerException(Code) | | Sets off the system event for an invalid file number requested.
Parameters: request - The Controller Request object sent to this controller forthe state handler. Parameters: myUser - The logged-in definition of the user currently logged in. throws: ControllerException - if the download file number was invalid. |
runBeginState | protected ControllerResponse runBeginState(ControllerRequest request, ControllerResponse response) throws ControllerException(Code) | | Starts a download for a file. Will provide the capability for client
side redirects to download the file from a public server
Parameters: request - The controller request object handed to us bythe framework Parameters: response - The controller Response that this class fills out. The generated ControllerResponse. throws: ControllerException - if there's an error with the processing of therequest. |
runDownloadState | protected ControllerResponse runDownloadState(ControllerRequest controllerRequest, ControllerResponse controllerResponse) throws ControllerException(Code) | | Returns the file actually requested by the user. Records the download
as well
Parameters: controllerRequest - The controller request object handed to us bythe framework Parameters: controllerResponse - The controller Response that this class fills out. The generated ControllerResponse. throws: ControllerException - if there's an error with the processing of therequest. |
runViewNotesState | protected void runViewNotesState(ControllerRequest request, ControllerResponse response) throws ControllerException(Code) | | View the notes associated with the download.
Parameters: request - The controller request object handed to us bythe framework Parameters: response - The controller Response that this class fills out. throws: ControllerException - upon error [data access or otherwise] |
|
|