Advertisement

05.22.2008 at 09:26PM PDT, ID: 23426615
[x]
Attachment Details

Reading specific values from properties file

Asked by bangviz in New to Java Programming

Tags: JAVA

Hi,

Can you please advise how do I read the specific values from my properties file.

My properties file uni.properties contains the following parameters

country.state=01,20,50,72
prog.district=05,55,79
branch.region=07,23,34


here is my pseudo code

My program

private String getCode(String classType) {

      String classCode = "";                              
            
      ResourceBundle value = ResourceBundle.getBundle("uni");

      if (classType.equalsIgnoreCase(value.getString("country.state"))){
            classCode = MyConstants.COUNTRY;
      }
                  
      if (classType.equalsIgnoreCase(value.getString("prog.district"))){
            classCode = MyConstants.PROGRAMME;
      }

      if (classType.equalsIgnoreCase(value.getString("branch.region"))){
            classCode = MyConstants.BRANCH;
      }

return classCode;

}

How do i read all the individuals comma seperated values 01 or 20 or 50 etc in my if condition
to put the appropriate classCode for each values.

Regs
bangvizStart Free Trial
 
Loading Advertisement...
 
[+][-]05.22.2008 at 10:06PM PDT, ID: 21629498

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: New to Java Programming
Tags: JAVA
Sign Up Now!
Solution Provided By: melchkishore
Participating Experts: 1
Solution Grade: A
 
 
[+][-]05.22.2008 at 10:56PM PDT, ID: 21629647

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.22.2008 at 11:06PM PDT, ID: 21629688

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.22.2008 at 11:07PM PDT, ID: 21629693

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.25.2008 at 07:11PM PDT, ID: 21644341

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.25.2008 at 09:47PM PDT, ID: 21644653

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.26.2008 at 03:04PM PDT, ID: 21648304

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.26.2008 at 03:04PM PDT, ID: 21648305

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.02.2008 at 06:30PM PDT, ID: 21697019

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.02.2008 at 10:06PM PDT, ID: 21697694

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.02.2008 at 11:03PM PDT, ID: 21697890

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.02.2008 at 11:21PM PDT, ID: 21697954

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.10.2008 at 10:08PM PDT, ID: 21756943

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628