In Practice

This lab focuses on reading key pairs from a file. The file will be used to hold configuration settings for the current user.

You will enhance a class named ConfigFile based on the following requirements:

  • The Properties class found in the java.Util package will be used to set properties, get properties, load properties, and restore properties.

  • The Properties class contains methods that will read and write the properties to a stream.

  • If the configuration file does not exist, create it.

  • If the configuration file does exist, load in the key pairs.

  • Implement methods to read a property, set a property, and save a property.

  • Allow the configuration file to be passed in the constructor of the class.

Step 1: Opening the Example and Reviewing ...

Get Borland® JBuilder™ Developer’s Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.