How to access a properties file from an external location.
Hi,
I am trying to access a properties file with resource bundle,which is not present in my exsisting package.
this.getClass().getClassLoader().getResourceAsStream ("C://ResourceFile//Application.properties");
this.getClass().getResourceAsStream ("C://ResourceFile//Application.properties");
objResources = ResourceBundle.getBundle ("ResourceFile.Application");
but I am getting null in the Stream.I have to put the properties file outside of my package(i,e not in my jar file).is there any way to access it?(without using IO Stream)
I have my Application.properties file in a hard coded path C:\ResourceFile(folder name)\Application.preperties.
Now I want to access this file from my program using resource bundle.
Is there any way as I am unable to get the this file from my program.Moreover I can't have my properties file in current CLASSPATH.
so, the standard way doesnt works?
FileInputStream fis = new FileInputStream("C:\\ResourceFile\\Application.properties");
Properties props = new Properties();
props.load(fis);
fis.close();
JLuisa at 2007-7-14 22:11:22 >

I have already tried it using IO Stream,but I am trying to get the properties file using Resource Bundle,as if I change my logic I have to make a lot of changes in my application.Anyways thanks for your suggestions.
ResourceBundle.getBundle() relies on a ClassLoader to locate the file. To make the loading work, there is no way other than:- putting the file inside the CLASSPATH (very easy fo fix)- writing a specific class loader to override this normal behaviour (good luck!)