Class FileResourceController


  • @RestController
    @Api(description="The fileresource controller",
         name="Fileresource controller")
    public class FileResourceController
    extends java.lang.Object
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      de.digitalcollections.model.api.paging.PageResponse<de.digitalcollections.model.api.identifiable.resource.FileResource> findAll​(int pageNumber, int pageSize, java.lang.String sortField, de.digitalcollections.model.api.paging.enums.Direction sortDirection, de.digitalcollections.model.api.paging.enums.NullHandling nullHandling)  
      org.springframework.http.ResponseEntity<de.digitalcollections.model.api.identifiable.resource.FileResource> get​(java.util.UUID uuid, java.util.Locale pLocale)  
      org.springframework.http.ResponseEntity<de.digitalcollections.model.api.identifiable.resource.FileResource> save​(java.lang.String resourceJson, org.springframework.web.multipart.MultipartFile file, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes, javax.servlet.http.HttpServletRequest request)  
      de.digitalcollections.model.api.identifiable.resource.FileResource update​(java.util.UUID uuid, de.digitalcollections.model.api.identifiable.resource.FileResource fileResource, org.springframework.validation.BindingResult errors)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FileResourceController

        public FileResourceController()
    • Method Detail

      • findAll

        @ApiMethod(description="get all fileresources")
        @GetMapping(value={"/latest/fileresources","/v2/fileresources"},
                    produces="application/json")
        @ApiResponseObject
        public de.digitalcollections.model.api.paging.PageResponse<de.digitalcollections.model.api.identifiable.resource.FileResource> findAll​(@RequestParam(name="pageNumber",required=false,defaultValue="0")
                                                                                                                                               int pageNumber,
                                                                                                                                               @RequestParam(name="pageSize",required=false,defaultValue="5")
                                                                                                                                               int pageSize,
                                                                                                                                               @RequestParam(name="sortField",required=false,defaultValue="uuid")
                                                                                                                                               java.lang.String sortField,
                                                                                                                                               @RequestParam(name="sortDirection",required=false,defaultValue="ASC")
                                                                                                                                               de.digitalcollections.model.api.paging.enums.Direction sortDirection,
                                                                                                                                               @RequestParam(name="nullHandling",required=false,defaultValue="NATIVE")
                                                                                                                                               de.digitalcollections.model.api.paging.enums.NullHandling nullHandling)
      • get

        @ApiMethod(description="get a fileresource as JSON or XML, depending on extension or <tt>format</tt> request parameter or accept header")
        @GetMapping(value={"/latest/fileresources/{uuid}","/v2/fileresources/{uuid}"},
                    produces={"application/json","application/xml"})
        @ApiResponseObject
        public org.springframework.http.ResponseEntity<de.digitalcollections.model.api.identifiable.resource.FileResource> get​(@ApiPathParam(description="UUID of the fileresource, e.g. <tt>599a120c-2dd5-11e8-b467-0ed5f89f718b</tt>") @PathVariable("uuid")
                                                                                                                               java.util.UUID uuid,
                                                                                                                               @ApiQueryParam(name="pLocale",description="Desired locale, e.g. <tt>de_DE</tt>. If unset, contents in all languages will be returned") @RequestParam(name="pLocale",required=false)
                                                                                                                               java.util.Locale pLocale)
                                                                                                                        throws de.digitalcollections.cudami.server.business.api.service.exceptions.IdentifiableServiceException
        Throws:
        de.digitalcollections.cudami.server.business.api.service.exceptions.IdentifiableServiceException
      • save

        @ApiMethod(description="save a newly created fileresource")
        @PostMapping(value={"/latest/fileresources","/v2/fileresources"},
                     produces="application/json")
        @ApiResponseObject
        public org.springframework.http.ResponseEntity<de.digitalcollections.model.api.identifiable.resource.FileResource> save​(@RequestParam("fileresource")
                                                                                                                                java.lang.String resourceJson,
                                                                                                                                @RequestPart("binaryData")
                                                                                                                                org.springframework.web.multipart.MultipartFile file,
                                                                                                                                org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes,
                                                                                                                                javax.servlet.http.HttpServletRequest request)
      • update

        @ApiMethod(description="update a fileresource")
        @PutMapping(value={"/latest/fileresources/{uuid}","/v2/fileresources/{uuid}"},
                    produces="application/json")
        @ApiResponseObject
        public de.digitalcollections.model.api.identifiable.resource.FileResource update​(@PathVariable
                                                                                         java.util.UUID uuid,
                                                                                         @RequestBody
                                                                                         de.digitalcollections.model.api.identifiable.resource.FileResource fileResource,
                                                                                         org.springframework.validation.BindingResult errors)
                                                                                  throws de.digitalcollections.cudami.server.business.api.service.exceptions.IdentifiableServiceException
        Throws:
        de.digitalcollections.cudami.server.business.api.service.exceptions.IdentifiableServiceException