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

    • Constructor Detail

      • FileService

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

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

      • setDao

        @Autowired
        @Qualifier("fileDao")
        public void setDao​(D dao)
        We have to use Qualifier to define the correct dao here. Otherwise, spring can not decide which dao has to be autowired here as there are multiple candidates.
        Overrides:
        setDao in class PermissionAwareCrudService<E extends File,​D extends FileDao<E>>
        Parameters:
        dao - the dao to set
      • uploadFile

        @PreAuthorize("isAuthenticated()")
        public E uploadFile​(org.springframework.web.multipart.MultipartFile file)
                     throws Exception
        Method persists a given MultipartFile as a bytearray in the database
        Parameters:
        file -
        Throws:
        Exception