jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yun <zhi...@ecquaria.com>
Subject Re: Retrieve coded filename from datastore
Date Tue, 04 Jan 2011 07:59:00 GMT

Hi,

Thanks for the help!! I will try it out.

Regards,
Yun

On Tue, Jan 4, 2011 at 3:53 PM, Seidel. Robert [via Jackrabbit] <
ml-node+3173152-525469104-207249@n4.nabble.com<ml-node%2B3173152-525469104-207249@n4.nabble.com>
> wrote:

> Hi,
>
> There are two possibilities:
>
> First:
>
> Create your own helper class within the jackrabbit-core-...jar to access
> the non public BLOBFileValue class and its non public method
> getDataIdentifier.
>
> Second:
>
> Reimplement the jackrabbit mechanism:
>
> FileDataStore
>
>         addRecord(InputStream input) {
>                 ...
>             // Copy the stream to the temporary file and calculate the
>             // stream length and the message digest of the stream
>             long length = 0;
>             MessageDigest digest = MessageDigest.getInstance(DIGEST);
>             OutputStream output = new DigestOutputStream(
>                     new FileOutputStream(temporary), digest);
>             try {
>                 length = IOUtils.copyLarge(input, output);
>             } finally {
>                 output.close();
>             }
>             DataIdentifier identifier = new
> DataIdentifier(digest.digest());
>                 ...
>
> Kindly Regards, Robert ;)
>
> -----Urspr√ľngliche Nachricht-----
> Von: yun [mailto:[hidden email]<http://user/SendEmail.jtp?type=node&node=3173152&i=0>]
>
> Gesendet: Dienstag, 4. Januar 2011 04:32
> An: [hidden email] <http://user/SendEmail.jtp?type=node&node=3173152&i=1>
> Betreff: Retrieve coded filename from datastore
>
>
> 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-datastore-tp3173010p3173010.html<http://jackrabbit.510166.n4.nabble.com/Retrieve-coded-filename-from-datastore-tp3173010p3173010.html?by-user=t>
> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
>
>
> ------------------------------
> View message @
> http://jackrabbit.510166.n4.nabble.com/Retrieve-coded-filename-from-datastore-tp3173010p3173152.html
> To unsubscribe from Retrieve coded filename from datastore, click here<http://jackrabbit.510166.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3173010&code=emhpeXVuQGVjcXVhcmlhLmNvbXwzMTczMDEwfC0xNTk3ODk3NTc5>.
>
>

-- 
View this message in context: http://jackrabbit.510166.n4.nabble.com/Retrieve-coded-filename-from-datastore-tp3173010p3173157.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message