Skip to main content
Enterprise Agile Planning icon with arrows

This post is from the CollabNet VersionOne blog and has not been updated since the original publish date.

Last Updated Mar 17, 2014 — Enterprise Agile Planning expert

Building VersionOne Integrations with Java (Part 2: Handling Configurations)

Enterprise Agile Planning

In this part of my series, we’re going to discuss configurations – what they are, why you might need them, and how to write the code to make them part of a VersionOne integration.

Here’s where we are in this series:

  • Part 1: Introduction
  • Part 2: Handling Configurations (YOU ARE HERE)
  • Part 3: Logging
  • Part 4: Parsing Data
  • Part 5: Using a HTTP Client
  • Part 6: Getting Data Out of VersionOne
  • Part 7: Submitting Data to VersionOne
  • Part 8: Calling VersionOne Operations
  • Part 9: Authenticating with OAuth
  • Part 10: Conclusion

Configurations are persisted values that can affect the behavior of an application, and they typically (or least should) live outside the source code of the application. For VersionOne integrations, configurations can be used for a variety of purposes including:

  • Setting the URL of the systems that are being integrated
  • Setting the credentials (username, password, etc.) used to access each system
  • Setting asset types and data fields that are being integrated
  • Setting log file configurations
  • Controlling the workflow of the integration

This is by no means a comprehensive list, as configurations that may be needed for an integration are bounded only by the needs of your particular workflow. The point is that most integrations require the ability to make use of values that are persisted outside of the core application code, and that can be easily modified without having to recompile your application.

There are many ways to persist configuration values such as in a database, XML, or some type of flat file. However, if you use one of those types of formats, you may find yourself having to write all the code that accesses them. Fortunately Java has a really simple and standardized way to handle properties with what is known as a “Properties” file. The core Java API has a class named java.util.Properties that can be used to access the data in a Properties file, as long as the data follows a certain format.

For example, here’s a simple Properties file entry for storing the URL of a VersionOne instance:

# The URL to the VersionOne instance.
instanceUrl={Server Base URI}

Note: The server base uri example used above is the full url to a VersionOne instance. See Server Base URI to learn more about how it is constructed.

Notice that the Property file entry is just a name-value pair, the content on the left of the equals sign is the property name; the content on right is the value.

To create a Properties file in a Java application, just create a new file and give it a .properties extension. Once you have your Properties file created, all you need to do to access its entries in your code is use a reader to load it into a Properties object like the following:

Properties properties;
try (FileReader reader = new FileReader("")) {
      properties = new Properties();
} catch (IOException e) {

Once you have the properties loaded, you can then call the getProperty or setProperty methods to read and write the properties as in the following:

properties.setProperty("instanceUrl", "{Server Base URI}");

As you can see, using this approach makes handling configurations very easy. However, if you need to have more complex configurations than just name-value pairs, you may need to consider another approach such as storing your configurations in an XML file.

That said, an advantage of using the Properties file approach is that there are other Java libraries that make use of it as well, which we’ll see in the next article that discusses logging.

As always, stay agile my friend…

More from the Blog

View more Government Cloud
Apr 12, 2022 Government Cloud receives FedRAMP Authorization through sponsorship from the United States Department of Veterans Affairs

Enterprise Agile Planning
Flagship Agility solutions can effectively scale agile deve ...
Read More
Nov 22, 2021

What are the qualities of highly effective agile teams?

Enterprise Agile Planning
A team is the core unit of productivity in an agile organization. Wher ...
Read More
Nov 15, 2021

How an open-first attitude revolutionized government tech development

Enterprise Agile Planning
Public perception of government is often that it is slow-moving, reluc ...
Read More
cross functional
Nov 08, 2021

6 best practices for building resilient cross-functional teams

Enterprise Agile Planning
Agile frameworks prize the quality of resilience within every facet of ...
Read More
Contact Us