public class FileControllerServiceImpl extends Object implements FileControllerService
Modifier and Type | Field and Description |
---|---|
protected static String |
DELETE_FILE_UPLOAD_LINE_DIALOG |
Constructor and Description |
---|
FileControllerServiceImpl() |
Modifier and Type | Method and Description |
---|---|
org.springframework.web.servlet.ModelAndView |
addFileUploadLine(UifFormBase form)
Invoked by the multiFile upload element to add a file object to the collection it controls.
|
org.springframework.web.servlet.ModelAndView |
deleteFileUploadLine(UifFormBase form)
Invoked by the multiFile upload widget to delete a file; Inform the model of file to delete.
|
protected CollectionControllerService |
getCollectionControllerService() |
void |
getFileFromLine(UifFormBase form,
javax.servlet.http.HttpServletResponse response)
Invoked by the multiFile upload widget to get the file contents for a file upload line.
|
protected ModelAndViewService |
getModelAndViewService() |
protected void |
sendFileFromLineResponse(UifFormBase form,
javax.servlet.http.HttpServletResponse response,
List<FileMeta> collection,
FileMeta fileLine)
Hook controller method to send a response back by using response.flushBuffer() using request/collection/fileLine
information provided.
|
void |
setCollectionControllerService(CollectionControllerService collectionControllerService) |
void |
setModelAndViewService(ModelAndViewService modelAndViewService) |
protected static final String DELETE_FILE_UPLOAD_LINE_DIALOG
public FileControllerServiceImpl()
public org.springframework.web.servlet.ModelAndView addFileUploadLine(UifFormBase form)
addFileUploadLine
in interface FileControllerService
form
- form instance containing the file datapublic org.springframework.web.servlet.ModelAndView deleteFileUploadLine(UifFormBase form)
deleteFileUploadLine
in interface FileControllerService
form
- form instance containing the file datapublic void getFileFromLine(UifFormBase form, javax.servlet.http.HttpServletResponse response)
getFileFromLine
in interface FileControllerService
form
- form instance containing the file request dataresponse
- Http response for streaming back the file contentsprotected void sendFileFromLineResponse(UifFormBase form, javax.servlet.http.HttpServletResponse response, List<FileMeta> collection, FileMeta fileLine)
A sample implementation may look like:
if (fileLine instanceof FileMetaBlob) {
InputStream is = ((FileMetaBlob) fileLine).getBlob().getBinaryStream();
response.setContentType("application/force-download");
response.setHeader("Content-Disposition", "attachment; filename=" + fileLine.getName());
// copy it to response's OutputStream
FileCopyUtils.copy(is, response.getOutputStream());
response.flushBuffer();
}
form
- form instance containing the file request dataresponse
- Http response object for streaming back the file contentscollection
- collection the file object belongs tofileLine
- the particular file line instance the contents should be sent back forprotected CollectionControllerService getCollectionControllerService()
public void setCollectionControllerService(CollectionControllerService collectionControllerService)
protected ModelAndViewService getModelAndViewService()
public void setModelAndViewService(ModelAndViewService modelAndViewService)
Copyright © 2005–2016 The Kuali Foundation. All rights reserved.