Class SwordApiController
java.lang.Object
eu.dnetlib.app.directindex.controllers.SwordApiController
@RestController
@RequestMapping("/api/sword/3.0")
@ConditionalOnProperty(value="dnet.directindex.sword.enabled",
havingValue="true")
public class SwordApiController
extends Object
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<SwordStatusDocument>addObject(String contentType, String contentDisposition, String digest, boolean inProgress, String mdFormat, String packaging, String slug, String json, org.springframework.security.core.Authentication authentication) org.springframework.http.ResponseEntity<Void>deleteObject(String id, org.springframework.security.core.Authentication authentication) org.springframework.http.ResponseEntity<ResultEntry>getMetadata(String id, org.springframework.security.core.Authentication authentication) handleException(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, Throwable e) org.springframework.http.ResponseEntity<Void>replaceMetadata(String contentDisposition, String contentLength, String contentType, String digest, String mdFormat, String id, ResultEntry result, org.springframework.security.core.Authentication authentication)
-
Constructor Details
-
SwordApiController
public SwordApiController()
-
-
Method Details
-
getServiceDocument
-
addObject
@PostMapping("/objects") public org.springframework.http.ResponseEntity<SwordStatusDocument> addObject(@RequestHeader("Content-Type") String contentType, @RequestHeader("Content-Disposition") String contentDisposition, @RequestHeader("Digest") String digest, @RequestHeader(value="In-Progress",defaultValue="false") boolean inProgress, @RequestHeader(value="Metadata-Format",defaultValue="http://purl.org/net/sword/3.0/types/Metadata") String mdFormat, @RequestHeader(value="Packaging",defaultValue="http://purl.org/net/sword/3.0/package/Binary") String packaging, @RequestHeader("Slug") String slug, @RequestBody String json, org.springframework.security.core.Authentication authentication) throws SwordException - Throws:
SwordException
-
getMetadata
@GetMapping("/objects/{id}/metadata") public org.springframework.http.ResponseEntity<ResultEntry> getMetadata(@PathVariable String id, org.springframework.security.core.Authentication authentication) throws SwordException - Throws:
SwordException
-
replaceMetadata
@PutMapping("/objects/{id}/metadata") public org.springframework.http.ResponseEntity<Void> replaceMetadata(@RequestHeader("Content-Disposition") String contentDisposition, @RequestHeader("Content-Length") String contentLength, @RequestHeader("Content-Type") String contentType, @RequestHeader("Digest") String digest, @RequestHeader(value="Metadata-Format",defaultValue="http://purl.org/net/sword/3.0/types/Metadata") String mdFormat, @PathVariable String id, @RequestBody ResultEntry result, org.springframework.security.core.Authentication authentication) throws SwordException - Throws:
SwordException
-
deleteObject
-
handleException
@ExceptionHandler(java.lang.Throwable.class) public SwordError handleException(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, Throwable e) throws IOException - Throws:
IOException
-