Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
Link: <http://example.org/some/content>; rel="http://fedora.info/definitions/fcrepo#ExternalContent"; handling="proxy"; type="image/tiff"
Link: <http://example.org/some/content>; rel="http://fedora.info/definitions/fcrepo#ExternalContent"; handling="proxy"; type="image/tiff"


The Fedora API specifies 3 methods of handling external content, all of which are supported.

...

If the external URI has a http prefix then a HEAD request is made to the URI provided in the Link header to retrieve the Content-type header, if this header is not returned the resource cannot be added to the repository.


Examples:

Proxying a file on the local server.

Creating the proxy LDP-NR

Code Block
> curl -i -H"Link: <file:///local/file/storage/wonderful.tiff>; rel=\"http://fedora.info/definitions/fcrepo#ExternalContent\"; handling=\"proxy\"; type=\"image/tiff\"" -XPUT -ufedoraAdmin:fedoraAdmin http://localhost:8080/rest/test_proxy_local_file
HTTP/1.1 201 Created
Date: Fri, 29 Jun 2018 14:15:54 GMT
Set-Cookie: JSESSIONID=aedg7ilmx9zxugi8x9em7l8h;Path=/
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Set-Cookie: rememberMe=deleteMe; Path=/; Max-Age=0; Expires=Thu, 28-Jun-2018 14:15:54 GMT
ETag: "0e409de61b53a864ad3a87f4faf884d88cf041ff"
Last-Modified: Fri, 29 Jun 2018 14:15:55 GMT
Link: <http://localhost:8080/rest/test_proxy_local_file/fcr:metadata>; rel="describedby"; anchor="http://localhost:8080/rest/test_proxy_local_file"
Link: <http://localhost:8080/static/constraints/NonRDFSourceConstraints.rdf>; rel="http://www.w3.org/ns/ldp#constrainedBy"
Content-Location: file:/local/file/storage/wonderful.tiff
Link: <http://localhost:8080/rest/test_proxy_local_file/fcr:acl>; rel="acl"
Location: http://localhost:8080/rest/test_proxy_local_file
Content-Type: text/plain
Content-Length: 48
Server: Jetty(9.3.1.v20150714)

http://localhost:8080/rest/test_proxy_local_file

HEAD request against the LDP-NR

Code Block
> curl -I http://localhost:8080/rest/test_proxy_local_file -ufedoraAdmin:fedoraAdmin
HTTP/1.1 200 OK
Date: Fri, 29 Jun 2018 14:17:56 GMT
Set-Cookie: JSESSIONID=1xkerzmclrq7vytfzi60zbjvi;Path=/
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Set-Cookie: rememberMe=deleteMe; Path=/; Max-Age=0; Expires=Thu, 28-Jun-2018 14:17:56 GMT
ETag: "0e409de61b53a864ad3a87f4faf884d88cf041ff"
Last-Modified: Fri, 29 Jun 2018 14:15:55 GMT
Content-Type: image/tiff
Accept-Ranges: bytes
Content-Disposition: attachment; filename=""; creation-date="Fri, 29 Jun 2018 14:15:55 GMT"; modification-date="Fri, 29 Jun 2018 14:15:55 GMT"; size=14761236
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/test_proxy_local_file/fcr:acl>; rel="acl"
Content-Location: file:/local/file/storage/wonderful.tiff
Link: <http://localhost:8080/rest/test_proxy_local_file/fcr:metadata>; rel="describedby"
Link: <http://localhost:8080/static/constraints/NonRDFSourceConstraints.rdf>; rel="http://www.w3.org/ns/ldp#constrainedBy"
Accept-External-Content-Handling: copy,redirect,proxy
Allow: DELETE,HEAD,GET,PUT,OPTIONS
Content-Length: 14761236
Server: Jetty(9.3.1.v20150714)