Current Release

This documentation covers the current version of Fedora. Looking for another version? See all documentation.


Request URI: /path/to/some/binary

Methods: HEAD, GET



HEAD Request the fixity checksum for a given digest algorithm

Checking fixity requires retrieving the content from the binary store and may take some time.


Request Headers:

WANT-DIGEST  md5, sha, sha-256, sha-512, sha-512/256


Example:

curl -I -H "Want-Digest: sha-256" "http://localhost:8080/rest/path/to/some/binary"

Response (fixity success):

Status: 200 OK
 
Headers:
ETag: "51c5ed5fff4b6c79233cc7573a387902f7d171e7"
X-State-Token: 51c5ed5fff4b6c79233cc7573a387902f7d171e7
Last-Modified: Fri, 04 May 2018 18:14:47 GMT
Content-Type: image/jpeg
Accept-Ranges: bytes
Content-Disposition: attachment; filename="IMG_4023.JPG.jpg"; creation-date="Fri, 04 May 2018 18:14:47 GMT"; modification-date="Fri, 04 May 2018 18:14:47 GMT"; size=47021
Link: <http://www.w3.org/ns/ldp#Resource>;rel="type"
Link: <http://www.w3.org/ns/ldp#NonRDFSource>;rel="type"
Link: <http://localhost:8080/rest/examples/binary/fcr:acl>; rel="acl"
Link: <http://localhost:8080/rest/examples/binary/fcr:metadata>; rel="describedby"
Link: <http://localhost:8080/static/constraints/NonRDFSourceConstraints.rdf>; rel="http://www.w3.org/ns/ldp#constrainedBy"
Link: <http://localhost:8080/rest/examples/binary>; rel="timegate"
Link: <http://localhost:8080/rest/examples/binary>; rel="original"
Link: <http://localhost:8080/rest/examples/binary/fcr:versions>; rel="timemap"
Link: <http://fedora.info/definitions/v4/repository#Resource>; rel="type"
Link: <http://mementoweb.org/ns#OriginalResource>; rel="type"
Link: <http://mementoweb.org/ns#TimeGate>; rel="type"
Accept-External-Content-Handling: copy,redirect,proxy
Allow: DELETE,HEAD,GET,PUT,OPTIONS
Digest: sha-256=08692ca74dc1e08c84f90feda5e64c72617be850a7c7adca88b03f6ccd3db406
Content-Length: 47021


Status:

200  OK

400 Bad request (the 'Want-Digest' request-header algorithm type is either invalid or unsupported)

404 Resource not found



Request URI: /path/to/some/resource/fcr:fixity

Methods: GET

GET Get the fixity report for an object

Checking fixity requires retrieving the content from the binary store and may take some time.

The /fcr:fixity endpoint is not part of the Fedora API Specification at this time.


Request Headers:

ACCEPT  application/ld+json, application/n-triples, application/rdf+xml, application/x-turtle, text/html, text/n3, text/plain, text/rdf+n3, text/turtle


Example:

curl -H "Accept: text/turtle" "http://localhost:8080/rest/path/to/some/resource/fcr:fixity"

Response (fixity success):

Status: 200 OK
 
Headers:
Content-Type: text/turtle
 
Body:

@prefix premis:  <http://www.loc.gov/premis/rdf/v1#> .
@prefix rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .

<http://localhost:8080/rest/rest/path/to/some/resource/#1b549f49-fc76-4f98-9ea5-f0e180c7ac59>
        premis:hasEventOutcome   "SUCCESS" ;
        premis:hasMessageDigest  <urn:sha-512:1aa0a39188bf944a6a3cfb5f5e67e5f9a34bc2b32ed923d45198eb1dee4dfce13552a18f6ab5ef1979d7dbda3d30fb6764c840cc80720bafbb7a1e1e66fdd819> ;
        premis:hasSize           "11162"^^<http://www.w3.org/2001/XMLSchema#long> ;
        rdf:type                 premis:EventOutcomeDetail ;
        rdf:type                 premis:Fixity .

<http://localhost:8080/rest/rest/path/to/some/resource>
        premis:hasFixity  <http://localhost:8080/rest/rest/path/to/some/resource/#1b549f49-fc76-4f98-9ea5-f0e180c7ac59> .


Response (fixity failure):

Status: 200 OK
Headers:
Content-Type: text/turtle
 
Body:

@prefix premis: <http://www.loc.gov/premis/rdf/v1#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .

<http://localhost:8080/rest/path/to/some/resource/#f73194e5-025e-487c-af4b-c31415c4e711>
        premis:hasEventOutcome   "BAD_CHECKSUM" ;
        premis:hasMessageDigest  <urn:sha-512:cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e> ;
        premis:hasSize           "11162"^^<http://www.w3.org/2001/XMLSchema#long> ;
        rdf:type                 premis:EventOutcomeDetail ;
        rdf:type                 premis:Fixity .

<http://localhost:8080/rest/rest/path/to/some/resource>
        premis:hasFixity  <http://localhost:8080/rest/path/to/some/resource/#f73194e5-025e-487c-af4b-c31415c4e711> .

Status:

200  OK

404 Resource not found


Note: Default Fixity Algorithm

When ingesting a binary resource, one or more checksums may be provided, see API reference (POST example 4, POST example 4b, PUT example 3). The supported algorithms are: SHA-1, SHA-256, SHA-512, SHA 512/256 and MD5. 

The algorithm used by the /fcr:fixity endpoint is determine by which digests are present for that binary. The default digest generated for all binaries comes from the fcrepo.persistence.defaultDigestAlgorithm configuration parameter, which defaults to SHA-512.


  • No labels