@Controller @RequestMapping(value="/file") public class FileController<E extends de.terrestris.shogun2.model.File,D extends de.terrestris.shogun2.dao.FileDao<E>,S extends FileService<E,D>> extends AbstractWebController<E,D,S>
LOG, service| Modifier | Constructor and Description |
|---|---|
|
FileController()
Default constructor, which calls the type-constructor
|
protected |
FileController(Class<E> entityClass)
Constructor that sets the concrete entity class for the controller.
|
| Modifier and Type | Method and Description |
|---|---|
org.springframework.http.ResponseEntity<?> |
getFile(Integer id)
Gets a file from the database by the given id
|
void |
setService(S service)
We have to use
Qualifier to define the correct service here. |
org.springframework.http.ResponseEntity<String> |
uploadFile(org.springframework.web.multipart.MultipartFile uploadedFile)
Persists a file as bytearray in the database
|
getEntityClass, getServicepublic FileController()
@Autowired @Qualifier(value="fileService") public void setService(S service)
Qualifier to define the correct service here.
Otherwise, spring can not decide which service has to be autowired here
as there are multiple candidates.setService in class AbstractWebController<E extends de.terrestris.shogun2.model.File,D extends de.terrestris.shogun2.dao.FileDao<E>,S extends FileService<E,D>>service - the service to set@RequestMapping(value="/upload.action",
method=POST)
public org.springframework.http.ResponseEntity<String> uploadFile(@RequestParam(value="file")
org.springframework.web.multipart.MultipartFile uploadedFile)
uploadedFile - @RequestMapping(value="/get.action",
method=GET)
public org.springframework.http.ResponseEntity<?> getFile(@RequestParam
Integer id)
SQLExceptionCopyright © 2016 terrestris GmbH & Co. KG. All rights reserved.