コード例 #1
0
 /** Load the whitelist from the properties file */
 static void loadWhitelist() {
   Properties whitelistProperties = new Properties();
   InputStream stream = null;
   try {
     stream =
         LookAheadObjectInputStream.class.getResourceAsStream(
             "/org/richfaces/resource/resource-serialization.properties");
     whitelistProperties.load(stream);
   } catch (IOException e) {
     throw new RuntimeException("Error loading the resource-serialization.properties file", e);
   } finally {
     if (stream != null) {
       try {
         stream.close();
       } catch (IOException e) {
         throw new RuntimeException("Error closing the resource-serialization.properties file", e);
       }
     }
   }
   for (String baseClassName : whitelistProperties.getProperty("whitelist").split(",")) {
     try {
       Class<?> baseClass = Class.forName(baseClassName);
       whitelistBaseClasses.add(baseClass);
     } catch (ClassNotFoundException e) {
       if (LOGGER.isInfoEnabled()) {
         LOGGER.debug(e);
       }
     }
   }
 }