コード例 #1
0
 /**
  * Load a properties object from a file.
  *
  * @param fileName the name of the properties file
  * @return the properties object
  */
 public static synchronized SortedProperties loadProperties(String fileName) throws IOException {
   SortedProperties prop = new SortedProperties();
   if (IOUtils.exists(fileName)) {
     InputStream in = null;
     try {
       in = IOUtils.openFileInputStream(fileName);
       prop.load(in);
     } finally {
       if (in != null) {
         in.close();
       }
     }
   }
   return prop;
 }