Class FileResourceController
- java.lang.Object
-
- de.digitalcollections.cudami.server.controller.identifiable.resource.FileResourceController
-
@RestController @Api(description="The fileresource controller", name="Fileresource controller") public class FileResourceController extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description FileResourceController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description de.digitalcollections.model.api.identifiable.resource.FileResourceapiUpload(javax.servlet.http.HttpServletRequest request)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>getByIdentifier(java.lang.String namespace, java.lang.String id)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.FileResourceupdate(java.util.UUID uuid, de.digitalcollections.model.api.identifiable.resource.FileResource fileResource, org.springframework.validation.BindingResult errors)
-
-
-
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
-
getByIdentifier
@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/identifier/{namespace}:{id}","/v2/fileresources/identifier/{namespace}:{id}"}, produces={"application/json","application/xml"}) @ApiResponseObject public org.springframework.http.ResponseEntity<de.digitalcollections.model.api.identifiable.resource.FileResource> getByIdentifier(@PathVariable java.lang.String namespace, @PathVariable java.lang.String id) 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
-
apiUpload
@PostMapping({"/latest/fileresources/new/upload","/v2/fileresources/new/upload"}) @ApiResponseObject public de.digitalcollections.model.api.identifiable.resource.FileResource apiUpload(javax.servlet.http.HttpServletRequest request) throws java.io.IOException- Throws:
java.io.IOException
-
-