Versions Compared

Key

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

Question

I have created a bare object in Fedora and I am trying to add in a dataStream via the REST API. However, I get the following error (in fedora.log) even though it looks like the datastream was added (which it was not). This is fedora Fedora 3.3.

INFO 2010-02-07 16:06:35.417 http-8080-4 (DefaultManagement) Completed addDatastream(pid: eureka:22, dsID: Source, altIDs: , dsLabel: Source file, versionable: true, MIMEType: application/pdf, formatURI: null, dsLocation: file:///Users/test.pdf, controlGroup: M, dsState: A, checksumType: null, checksum: null, logMessage: Added source)
ERROR 2010-02-07 16:06:35.418 http-8080-4 (DatastreamResource) Unexpected error fulfilling REST API request
fedora.server.errors.HttpServiceNotFoundException: DefaultExternalContentManager returned an error. The underlying error was a fedora.server.errors.HttpServiceNotFoundException
The message was "Policy blocked datastream resolution" .

...

I've been trying to find the right place where the policy is defined but cannot locate it.

Answer

The policy which is responsible for blocking the resolution of this datastream URI is located in deny-unallowed-file-resolution.xml (see fedora.fcfg for the repository policies directory).
The file also contains an example rule how to selectively enable file:// URIs. If you remove the comments and adapt the regex to your file's location the addDatastream operation should work.

...