Class FileController<E extends File,​D extends FileDao<E>,​S extends FileService<E,​D>>

    • Constructor Detail

      • FileController

        public FileController()
        Default constructor, which calls the type-constructor
      • FileController

        protected FileController​(Class<E> entityClass)
        Constructor that sets the concrete entity class for the controller. Subclasses MUST call this constructor.
    • Method Detail

      • setService

        @Autowired
        @Qualifier("fileService")
        public void setService​(S service)
        We have to use Qualifier to define the correct service here. Otherwise, spring can not decide which service has to be autowired here as there are multiple candidates.
        Specified by:
        setService in class AbstractWebController<E extends File,​D extends FileDao<E>,​S extends FileService<E,​D>>
        Parameters:
        service - the service to set
      • uploadFile

        @RequestMapping(value="/upload.action",
                        method=POST)
        public org.springframework.http.ResponseEntity<?> uploadFile​(@RequestParam("file")
                                                                     org.springframework.web.multipart.MultipartFile uploadedFile)
        Persists a file as bytearray in the database
        Parameters:
        uploadedFile -
      • getFile

        @RequestMapping(value="/get.action",
                        method=GET)
        public org.springframework.http.ResponseEntity<?> getFile​(@RequestParam
                                                                  Integer id)
        Gets a file from the database by the given id