Hi, Thanks a lot.
-----Original Message----- From: Freeman Fang [mailto:[email protected]] Sent: Monday 18 July 2011 13:01 To: [email protected] Subject: Re: Unable to find resources files Hi, Something like java.io.FileInputStream file = new java.io.FileInputStream("etc/ startup.properties"); However, if you want to use properties under etc folder in OSGi bundle, I suggest you should leverage OSGi ConfigAdmin to do so. Freeman. On 2011-7-18, at 下午5:46, BERTRAND Antoine AWL-IT wrote: > Hi, > > Thanks it's working now. > > But what if I want to put the resource files in SERVICEMIX/etc ? > For example a .properties file ? > > Regards, > Antoine > > -----Original Message----- > From: Freeman Fang [mailto:[email protected]] > Sent: Saturday 16 July 2011 00:56 > To: [email protected] > Subject: Re: Unable to find resources files > > Hi, > > Put the resource file into your bundle jar, then in the bundle jar > code try with > this > .getClass > ().getClassLoader().getResource("relative_path_to_the_resource"); > This should work. > > Freeman > On 2011-7-15, at 下午11:23, BERTRAND Antoine AWL-IT wrote: > >> Hi all, >> >> I've a library (jar) that needs to load some resource files. >> But I'm wondering where to put those files. >> >> The library load the files like that: >> URL url = ClassLoader.getSystemResource(filename); >> >> I've tried to put the resources file into: >> - The jar >> - Servicemix etc folder >> - Servicemix lib folder >> But none worked, url is null. >> >> So why my resource files are not loaded and how servicemix handle >> resource files loading ? >> >> Regrads, >> Antoine >> >> >> Atos Worldline SA/NV - Chaussee de Haecht 1442 Haachtsesteenweg >> - 1130 Brussels - Belgium >> RPM-RPR Bruxelles-Brussel - TVA-BTW BE 0418.547.872 >> Bankrekening-Compte Bancaire-Bank Account 310-0269424-44 >> BIC BBRUBEBB - IBAN BE55 3100 2694 2444 >> >> "The information contained in this e-mail and any attachment thereto >> is confidential and may contain information which is protected by >> intellectual property rights. >> This information is intended for the exclusive use of the >> recipient(s) named above. >> This e-mail does not constitute any binding relationship or offer >> toward any of the addressees. >> If you are not one of the addressees , one of their employees or a >> proxy holder entitled to hand over this message to the addressee(s), >> any use of the information contained herein (e.g. reproduction, >> divulgation, communication or distribution,...) is prohibited. >> If you have received this message in error, please notify the sender >> and destroy it immediately after. >> The integrity and security of this message cannot be guaranteed and >> it may be subject to data corruption, interception and unauthorized >> amendment, for which we accept no liability." >> > > --------------------------------------------- > Freeman Fang > > FuseSource > Email:[email protected] > Web: fusesource.com > Twitter: freemanfang > Blog: http://freemanfang.blogspot.com > > > > > > > > > > > > Atos Worldline SA/NV - Chaussee de Haecht 1442 Haachtsesteenweg > - 1130 Brussels - Belgium > RPM-RPR Bruxelles-Brussel - TVA-BTW BE 0418.547.872 > Bankrekening-Compte Bancaire-Bank Account 310-0269424-44 > BIC BBRUBEBB - IBAN BE55 3100 2694 2444 > > "The information contained in this e-mail and any attachment thereto > is confidential and may contain information which is protected by > intellectual property rights. > This information is intended for the exclusive use of the > recipient(s) named above. > This e-mail does not constitute any binding relationship or offer > toward any of the addressees. > If you are not one of the addressees , one of their employees or a > proxy holder entitled to hand over this message to the addressee(s), > any use of the information contained herein (e.g. reproduction, > divulgation, communication or distribution,...) is prohibited. > If you have received this message in error, please notify the sender > and destroy it immediately after. > The integrity and security of this message cannot be guaranteed and > it may be subject to data corruption, interception and unauthorized > amendment, for which we accept no liability." --------------------------------------------- Freeman Fang FuseSource Email:[email protected] Web: fusesource.com Twitter: freemanfang Blog: http://freemanfang.blogspot.com Atos Worldline SA/NV - Chaussee de Haecht 1442 Haachtsesteenweg - 1130 Brussels - Belgium RPM-RPR Bruxelles-Brussel - TVA-BTW BE 0418.547.872 Bankrekening-Compte Bancaire-Bank Account 310-0269424-44 BIC BBRUBEBB - IBAN BE55 3100 2694 2444 "The information contained in this e-mail and any attachment thereto is confidential and may contain information which is protected by intellectual property rights. This information is intended for the exclusive use of the recipient(s) named above. This e-mail does not constitute any binding relationship or offer toward any of the addressees. If you are not one of the addressees , one of their employees or a proxy holder entitled to hand over this message to the addressee(s), any use of the information contained herein (e.g. reproduction, divulgation, communication or distribution,...) is prohibited. If you have received this message in error, please notify the sender and destroy it immediately after. The integrity and security of this message cannot be guaranteed and it may be subject to data corruption, interception and unauthorized amendment, for which we accept no liability."
