Your Java Operating Environment (created 2013 03 24)

The purpose of this investigation is to gain familiarity with some of Java's underlying operating environment classes.

Task.

  1. Create a project entitled OpEnvOps and a driver by the same name.
  2. The 'preconstructed' System class holds information regarding your operating environment. After reviewing the documentation for the System class and the Properties class, add the public static void displayProperties() method to your driver that will display the names of the over 4 dozen properties the class maintains.
  3. Provide additional code to your displayProperties() method that will display the value of each property beside the property name. Separate the property->value pair by a tab character.
  4. Copy the contents of the Console Window to the clipboard, open a new Excel workbook, and paste in the contents of the clipboard. Format the worksheet to look identical to the image to the right. Save the Excel workbook as OpEnvProps.xlsx and submit to handin.
  5. Through the use of JOptionPane's showInputDialog() method, obtain a property name from the user. Pass the user-submitted String to a new method public static void displayProperty(String property) that will determine and display the specific property->value pair. If the property does not exist, say so.
Examination of the File class suggests many useful methods that can be used to access and manipulate files and folders. One of the constructors of File class accepts a path name. The Package Explorer in Eclipse reveals the file structure of each Project. Expand the OpEnvOps folder to see what files appear in the root folder. You goal in the next stage is to display the names of entries in the root of the OpEnvOps folder to the Console Window
  1. As you can see from your Excel worksheet, many of the property values are absolute path names. One of the more useful properties is user.dir that holds the path to the active project in which you are working. Implement the method public static void displayUserDirFiles() that will display the filenames of the entries in the root of the user.dir folder.
  2. Submit your fully javadoced OpEnvOps.java source code to handin under the Subject Line: Operating Environment. by the end of the period.

To be continued...