> I am attempting to add a datastream to a digital object using API-M's  
> `addDatastream` operation.

your best bet would be the list's archive. the question came up a few time  
sthe last months.


> What should be the appropriate value for the `dsLocation` parameter?

depends on your datatsream's type. for everything but an internal it has  
to be a supported (ie http or https, maybe even ftp) url.

for an internal ds you might give the content as a string if i recall  
correctly (unfortunately there happened a lot since i did it the last time  
and i forget the fine print).
or you use the approach below, refernce an empty xml file and use  
modifyDatastreamByValue, which allows for ds content as byte[].

> If I point to a file (like file.xml), I get malformed URL.  If I append  
> `file://` to the file's name, I get invalid protocol error.

if your datatstream is an external one, you need to make the file  
available via network access, as said above.
either you put the files up to a server yourself and reference the url or  
you use the fedora helper (FedoraClient.uploadFile(File)), which allows to  
upload the content to fedora and returns an url you can use in a limited  
timeframe (5min is the default), before it expires.

> I see the Fedora Client GUI can do this (adding content of a XML file as  
> a datastream).

well, your best bet is to fetch the source of the gui client and to look  
how it is done :-)

------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
Fedora-commons-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fedora-commons-developers

Reply via email to