@Controller @RequestMapping(value="/file") public class FileController<E extends File,D extends FileDao<E>,S extends FileService<E,D>> extends AbstractWebController<E,D,S>
logger, 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<?> |
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 File,D extends FileDao<E>,S extends FileService<E,D>>service - the service to set@RequestMapping(value="/upload.action",
method=POST)
public org.springframework.http.ResponseEntity<?> 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)
Copyright © 2020 terrestris GmbH & Co. KG. All rights reserved.