Keel 2.1RC2

org.keel.apps.fileservices.model
Class FileDownloadModel

java.lang.Object
  extended byorg.keel.services.model.StandardModel
      extended byorg.keel.services.model.StandardLogEnabledModel
          extended byorg.keel.apps.fileservices.model.FileDownloadModel
All Implemented Interfaces:
Configurable, LogEnabled, Model

public class FileDownloadModel
extends StandardLogEnabledModel

Author:
sdutt This class is a service in keel to provide the file download functionality using struts as client. It takes the full path of the file to download as a request param. This model is dependant on the clnt-struts module in keel. The ModelAction class receives the bytes of the downloading file and sends it to the browser as a response element. All the proper header information for the response is set as attributes in the ModelResponse and the ModelAction class extracts them and sets them to the HTTPResponse. The mimetype of the file has to be set for proper download. The mimetype is obtained from the fileuploadmetadata persistent object. This info is saved during the fileupload process. NOTE - If the file to download was never uploaded via this service then the mimetype and other info has to be set in the fileuploadmetadata persistent manually.

Field Summary
 
Fields inherited from class org.keel.services.model.StandardLogEnabledModel
log
 
Fields inherited from class org.keel.services.model.StandardModel
configuration
 
Fields inherited from interface org.keel.services.model.Model
ROLE
 
Constructor Summary
FileDownloadModel()
           
 
Method Summary
 ModelResponse execute(ModelRequest req)
           
private  sun.net.www.MimeEntry getContentType(java.lang.String file_to_download)
           
 
Methods inherited from class org.keel.services.model.StandardLogEnabledModel
enableLogging
 
Methods inherited from class org.keel.services.model.StandardModel
configure, getConfiguration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileDownloadModel

public FileDownloadModel()
Method Detail

execute

public ModelResponse execute(ModelRequest req)
                      throws ModelException
Throws:
ModelException

getContentType

private sun.net.www.MimeEntry getContentType(java.lang.String file_to_download)
Parameters:
file_to_download -
Returns:

Keel 2.1RC2

Please see keelframework.org for information about new Keel releases.