Return-Path: Delivered-To: apmail-jackrabbit-users-archive@minotaur.apache.org Received: (qmail 22459 invoked from network); 4 Jan 2011 07:53:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 4 Jan 2011 07:53:53 -0000 Received: (qmail 26616 invoked by uid 500); 4 Jan 2011 07:53:52 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 26531 invoked by uid 500); 4 Jan 2011 07:53:50 -0000 Mailing-List: contact users-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@jackrabbit.apache.org Delivered-To: mailing list users@jackrabbit.apache.org Received: (qmail 26519 invoked by uid 99); 4 Jan 2011 07:53:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Jan 2011 07:53:49 +0000 X-ASF-Spam-Status: No, hits=1.3 required=10.0 tests=SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [194.172.26.33] (HELO MX1.aeb.de) (194.172.26.33) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Jan 2011 07:53:44 +0000 X-IronPort-AV: E=Sophos;i="4.60,271,1291590000"; d="scan'208";a="6524090" Received: from unknown (HELO S-HQMX7.pmbelz.de) ([10.237.5.7]) by MX1I.pmbelz.de with ESMTP; 04 Jan 2011 08:53:22 +0100 Received: from S-HQMX7.pmbelz.de ([fe80::c4b6:4b67:cd89:2050]) by S-HQMX7.pmbelz.de ([fe80::c4b6:4b67:cd89:2050%15]) with mapi; Tue, 4 Jan 2011 08:53:22 +0100 From: "Seidel. Robert" To: "users@jackrabbit.apache.org" Date: Tue, 4 Jan 2011 08:53:26 +0100 Subject: AW: Retrieve coded filename from datastore Thread-Topic: Retrieve coded filename from datastore Thread-Index: AcurwAVT02XPPtmcSO+Dn1kxD1H4agAIkGdg Message-ID: References: <1294111912733-3173010.post@n4.nabble.com> In-Reply-To: <1294111912733-3173010.post@n4.nabble.com> Accept-Language: de-DE Content-Language: de-DE X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: de-DE Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Hi, There are two possibilities: First: Create your own helper class within the jackrabbit-core-...jar to access th= e non public BLOBFileValue class and its non public method getDataIdentifie= r. Second:=20 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 =3D 0; MessageDigest digest =3D MessageDigest.getInstance(DIGEST); OutputStream output =3D new DigestOutputStream( new FileOutputStream(temporary), digest); try { length =3D IOUtils.copyLarge(input, output); } finally { output.close(); } DataIdentifier identifier =3D new DataIdentifier(digest.digest(= )); ... Kindly Regards, Robert ;) -----Urspr=FCngliche Nachricht----- Von: yun [mailto:zhiyun@ecquaria.com]=20 Gesendet: Dienstag, 4. Januar 2011 04:32 An: users@jackrabbit.apache.org 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.=20 Question: Is there a way to obtain this name through some java codes when writing the file to the repository?=20 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. --=20 View this message in context: http://jackrabbit.510166.n4.nabble.com/Retrie= ve-coded-filename-from-datastore-tp3173010p3173010.html Sent from the Jackrabbit - Users mailing list archive at Nabble.com.