Пример #1
0
 private Map<PropertyKey, String> readConf(boolean isDef) throws SystemCoreException {
   InputStream in = null;
   try {
     if (isDef) in = findNodeDefConfStream();
     else in = findNodeConfStream();
     if (in == null) {
       if (!isDef)
         SystemLogger.info(
             "Server configuration provider could not find any '"
                 + SERVER_CONF
                 + "' file inconfiguration directory or in class path; Using default only.");
       return null;
     } else {
       Properties props = new Properties();
       props.load(in);
       loadSystemProperties(props);
       return MapConfiguration.convert(props);
     }
   } catch (IOException e) {
     throw new SystemCoreException(
         "Server configuration provider failed to read configuration; Received message: "
             + e.getMessage(),
         e);
   } finally {
     IoUtil.safeClose(in);
   }
 }
Пример #2
0
 private ConfigProperty[] cloneProperties() {
   int count = 0;
   Map<PropertyKey, String> map = configuration.cloneProperties();
   ConfigProperty[] arr = new ConfigProperty[map.size()];
   for (Entry<PropertyKey, String> e : map.entrySet()) {
     arr[count++] = new ConfigProperty(e.getKey(), e.getValue());
   }
   return arr;
 }