Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Juana Fisher   on Feb 11 In Java Category.

  
Question Answered By: Omar Walker   on Feb 11

create a propertyhandler class

// use this method for loading the file  and use the refernce of class  in u r
code and call the constants from u r properties  file
public int loadPropertyFile(String propFileName)
{
String sMethodName = sClassName+".loadPropertyFile";
int rc = -1;
try {
FileInputStream propIS = new FileInputStream( propFileName );
this.load(propIS);
propIS.close();
rc = 0;
} catch (Exception e) {
rc = -1;
//if (debug) System.out.println ("!!!! ERROR: "+sMethodName+" property
file '"+propFileName+"' not found !!");
System.out.println ("!!!! ERROR: "+sMethodName+" property file
'"+propFileName+"' not found !!");
}
return rc;
}

Share: 

 
 
Didn't find what you were looking for? Find more on Load Resource Bundle at runtime Or get search suggestion and latest updates.


Tagged: