Return-Path: Delivered-To: apmail-incubator-felix-dev-archive@www.apache.org Received: (qmail 58210 invoked from network); 19 Dec 2006 11:15:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Dec 2006 11:15:27 -0000 Received: (qmail 53287 invoked by uid 500); 19 Dec 2006 11:15:35 -0000 Delivered-To: apmail-incubator-felix-dev-archive@incubator.apache.org Received: (qmail 53046 invoked by uid 500); 19 Dec 2006 11:15:34 -0000 Mailing-List: contact felix-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: felix-dev@incubator.apache.org Delivered-To: mailing list felix-dev@incubator.apache.org Received: (qmail 53030 invoked by uid 99); 19 Dec 2006 11:15:33 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Dec 2006 03:15:33 -0800 X-ASF-Spam-Status: No, hits=0.6 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [217.32.164.139] (HELO smtp5.smtp.bt.com) (217.32.164.139) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Dec 2006 03:15:22 -0800 Received: from i2kc07-ukbr.domain1.systemhost.net ([193.113.197.14]) by smtp5.smtp.bt.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 19 Dec 2006 11:15:00 +0000 Received: from E03MVW2-UKDY.domain1.systemhost.net ([193.113.30.46]) by i2kc07-ukbr.domain1.systemhost.net with Microsoft SMTPSVC(6.0.3790.211); Tue, 19 Dec 2006 11:14:29 +0000 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: How to read a folder from the bundle Date: Tue, 19 Dec 2006 11:14:28 -0000 Message-ID: <581E6D1870B800498D7BC4C1912D7A7DF37833@E03MVW2-UKDY.domain1.systemhost.net> In-Reply-To: <4586F14F.5020709@ungoverned.org> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: How to read a folder from the bundle Thread-Index: Acci6uqxT95cqmHZSy2pbEUyUiyjhAAc9Ieg From: To: X-OriginalArrivalTime: 19 Dec 2006 11:14:29.0339 (UTC) FILETIME=[D9EC52B0:01C7235E] X-Virus-Checked: Checked by ClamAV on apache.org Hi,Richard. Thank you for the information. Can you specify how to use the getEntry method? Thank you very much again=20 Regards Wei Hui Tan Student Researcher=20 BT Office: +44 (0)1473 605441 Mobile: +44 (0)7816 162922 Fax: +44 (0)1473 606702 Email: weihui.tan@bt.com British Telecommunications plc Registered office: 81 Newgate Street London EC1A 7AJ Registered in England no. 1800000=20 This electronic message contains information from British Telecommunications plc which may be privileged or confidential. The information is intended to be for the use of the individual(s) or entity named above. If you are not the intended recipient be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic message in error, please notify us by telephone or email (to the numbers or address above) immediately. Activity and use of the British Telecommunications plc email system is monitored to secure its effective operation and for other lawful business purposes. Communications using this system will also be monitored and may be recorded to secure effective operation and for other lawful business purposes. -----Original Message----- From: Richard S. Hall [mailto:heavy@ungoverned.org]=20 Sent: 18 December 2006 19:52 To: felix-dev@incubator.apache.org Subject: Re: How to read a folder from the bundle I am not sure I totally understand your situation, but assume that we have a bundle with the following content from the root of its JAR file: org/ foo/ resource/ file1.xml file2.xml file3.xml Now further assume that our bundle has the following bundle class path: Bundle-ClassPath: . You should be able to access any of these resources using class.getResourceAsStream("org/foo/resource/file1.xml") and so on. The important point here is that these resources are accessible on the bundle's internal class path. On the other hand, if you have some arbitrary folder inside of your bundle that is not on your bundle's internal class path, then you will have to use the bundle entry-related methods, e.g., Bundle.getEntry(), to gain access to them. -> richard weihui.tan@bt.com wrote: > Hi, guys, I want to read a group of file from a folder inside the osgi > bundle. The reading of the files is done automatically by the API, and > only one of the file can be create as the entry point. Suppose that I=20 > create a file : File xx =3D new File("ddd.xxx"); I try to read it as=20 > stream where I use class.getResourceAsStream() method to read the=20 > entry file. However for the other file inside the folder it can not be done. > If I don't read the files using OSGi I can do it properly. But once I=20 > use Osgi tech, I can deploy the bundle. Does anybody knows how to=20 > register the folder so that I can read the whold folder freely Just=20 > like in the HTTPContext where it provide the registerResource method=20 > for the image reading in the servlet. > Thank you very much > =20 > Regards > Wei Hui Tan > Student Researcher > BT > > Office: +44 (0)1473 605441 > Mobile: +44 (0)7816 162922 > Fax: +44 (0)1473 606702 > Email: weihui.tan@bt.com > > British Telecommunications plc > Registered office: 81 Newgate Street London EC1A 7AJ Registered in=20 > England no. 1800000 > > This electronic message contains information from British=20 > Telecommunications plc which may be privileged or confidential. The=20 > information is intended to be for the use of the individual(s) or=20 > entity named above. If you are not the intended recipient be aware=20 > that any disclosure, copying, distribution or use of the contents of=20 > this information is prohibited. If you have received this electronic=20 > message in error, please notify us by telephone or email (to the=20 > numbers or address above) immediately. > > Activity and use of the British Telecommunications plc email system is > monitored to secure its effective operation and for other lawful=20 > business purposes. Communications using this system will also be=20 > monitored and may be recorded to secure effective operation and for=20 > other lawful business purposes. > > > > =20