Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7633781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T06:58:56+00:00 2026-05-31T06:58:56+00:00

Can some one throw some light on what is common configuration (apache common configuration)?

  • 0

Can some one throw some light on what is common configuration (apache common configuration)?
It will he helpful if some one can explain it with some use-case.

Also any links (other than google) from where I can get some useful information are very much appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T06:58:58+00:00Added an answer on May 31, 2026 at 6:58 am

    Apache Commons Configuration is most famous for the library’s ability for you to work with configuration files, i.e. parse in .properties file.

    For example:

    color=Green
    person=John
    

    This property file may reside in a classpath or in a hard directory. Using Apache Commons Configurations, you may parse in the parse easily, and get to the value represented by its key.

    See this quick tutorial.

    EDIT

    But why configuration or Apache Commons Configurations?

    Sometimes, you do not wish to hard code a particular value into the codes that are to be compiled. For example, you may have a application variable BACKGROUND_COLOR, the value of this variable controls the color of the background of your application. How would you store this in your application?

    You can do this:

    public static final String BACKGROUND_COLOR = "Green";
    

    However, if you want to change the color of the background into “Red”, then you would have to change the above code, recompile it into:

    public static final String BACKGROUND_COLOR = "Red";
    

    What if you do not want to change your codes, recompile to change the background of your application? Yes, you could store this value into a text file called system.properties, or any name and extension actually.

    For example, you can store it in system.properties:

    background_color=Green
    

    But how do you read this text file? (which is saves in properties format, key=value) Would you want to go into low level File and IO in order to read these values? Chances are you don’t, you would want a mature and established library to do so for you.

    For this purpose, you may use the Apache Commons Configurations. This library is primed for reading configurations such as a properties file.

    Using Apache Commons Configurations, here are the codes to read the above properties file and extract the value of the key background_color.

    public static void main(String [] args){
      Configuration config = new PropertiesConfiguration("system.properties");
      String backColor = config.getString("background_color");
      System.out.println(backColor); // this will give you green
    }
    

    Hope this helps to your understanding. 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can any one throw some light on the process of finding old recovery files
Can some one specify the windows API, one need to use in order to
Can some one explain to me the difference between categories and inheritance in Objective
Can some one recommend any free program which counts the number of clicks Clicked
Can some one shed some light on the difference between XML and XMI? Can
How to pass parameters to [WebMethod] in Asp.Net(C#) ? Can some one please explain
Can someone please throw some light on how to go about rendering an hyperlink
Can somebody please throw some light on the arcane error Failed to set top
Can some one post an example of using syslog outputter for log4r, I am
Can some one please guide me to understand which jar file i need to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.