2 Replies Latest reply: Mar 17, 2009 5:39 PM by camickr RSS

    Java Properties File - Making Certain Entries Required

      When reading properties from an XML formatted properties file, I want the properties.getProperty() method to throw an exception if the property that I am loading is not in the properties file.

      The reason for this is that some of the setting in my application that I am working on are critical to the application running at all, and instead of writing if then statements to see if has been set, I can just have Java throw an exception if i isn't set.. That would make life a lot easier for me!

      Can this be done? or am I stuck writing 100 "if *(blah == null stats ) in order to validate my properties file?