Hi, I have updated the wiki page at http://wiki.apache.org/jackrabbit/DataStore#Retrieve_the_Identifier
Regards, Thomas On 1/4/11 10:16 AM, "Seidel. Robert" <[email protected]> wrote: >Hi Yun, > >I think it should work this way... > > (resNode is a nt:resource node, input is the input stream and >jcr_data is jcr:data) > > resNode.setProperty(JcrConstants.JCR_DATA, resNode.getSession() > .getValueFactory().createBinary(input)); > Value value = >resNode.getProperty(JcrConstants.JCR_DATA).getValue(); > if (value instanceof JackrabbitValue) { > JackrabbitValue j = (JackrabbitValue) value; > ... j.getContentIdentity(); > } > >But I didn't have the time to test it yet, I'll try it later and change >my code to the official way ;) > >Regards, Robert > >-----Ursprüngliche Nachricht----- >Von: yun [mailto:[email protected]] >Gesendet: Dienstag, 4. Januar 2011 09:57 >An: [email protected] >Betreff: Re: Retrieve coded filename from datastore > > >Hi Thomas, > >I am having trouble in geting the JackrabbitValue from the Jackrabbit >repository. I do not understand how to get the jackrabbitvalue from >jackrabbit when I am inputting a file into the jackrabbit repository. > >Regards, >Yun >On Tue, Jan 4, 2011 at 4:04 PM, Thomas Mueller [via Jackrabbit] < >[email protected]<ml-node%2B3173162-140800278 >[email protected]> >> wrote: > >> Hi, >> >> As documented in http://wiki.apache.org/jackrabbit/DataStore#API you can >> retrieve the identifier using >> >> JackrabbitValue.getContentIdentity() >> >> >> JackrabbitValue is the public Jackrabbit API. Using non-public classes >>or >> methods or re-implementing things in Jackrabbit is not required. >> >> Regards, >> Thomas >> >> >> >> On 1/4/11 4:31 AM, "yun" <[hidden >>email]<http://user/SendEmail.jtp?type=node&node=3173162&i=0>> >> wrote: >> >> > >> >Hi, >> > >> >I know that we are not suppose to get the coded file from >> >"jackrabbit\repository\datastore" folder where the raw files are >>stored by >> >> >the jack rabbit repository. Example of a filename would be: >> >52cd141937e037b89c8989d1411f63e98bcb7981 >> > >> >The file name is named by using the "52\cd\14" in >> >"repository\datastore\52\cd\14" which is the folder where the file is >> >stored. >> > >> >Question: >> > >> >Is there a way to obtain this name through some java codes when writing >> >the >> >file to the repository? >> > >> >I need this file name as a backup option if ever the repository is >> >corrupted, I would still have an option to retrieve the file from the >> >folders according to the filename. Thanks. >> >-- >> >View this message in context: >> > >> >>http://jackrabbit.510166.n4.nabble.com/Retrieve-coded-filename-from-datas >>t<http://jackrabbit.510166.n4.nabble.com/Retrieve-coded-filename-from-dat >>ast?by-user=t> >> >ore-tp3173010p3173010.html >> >Sent from the Jackrabbit - Users mailing list archive at Nabble.com. >> >> >> >> ------------------------------ >> View message @ >> >>http://jackrabbit.510166.n4.nabble.com/Retrieve-coded-filename-from-datas >>tore-tp3173010p3173162.html >> >> To unsubscribe from Retrieve coded filename from datastore, click >>here<http://jackrabbit.510166.n4.nabble.com/template/NamlServlet.jtp?macr >>o=unsubscribe_by_code&node=3173010&code=emhpeXVuQGVjcXVhcmlhLmNvbXwzMTczM >>DEwfC0xNTk3ODk3NTc5>. >> >> > >-- >View this message in context: >http://jackrabbit.510166.n4.nabble.com/Retrieve-coded-filename-from-datast >ore-tp3173010p3173207.html >Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
