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 Details

    • SwordApiController

      public SwordApiController()
  • Method Details

    • getServiceDocument

      @GetMapping("/service-document") public SwordServiceDocument 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

      @DeleteMapping("/objects/{id}") public org.springframework.http.ResponseEntity<Void> deleteObject(@PathVariable String id, org.springframework.security.core.Authentication authentication)
    • 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