@Singleton public static synchronized void loadLicenseMaps(String firstOption) throws InvalidConfigException {
  if (licenses == null || licenseTexts == null) {
    licenses=new TreeMap<String,String>();
    licenses.put("",(firstOption == null) ? "-" : firstOption);
    licenseTexts=new TreeMap<String,String>();
    Properties properties=licenseProperties();
    for (    Map.Entry<Object,Object> entry : properties.entrySet()) {
      String key=StringUtils.trim((String)entry.getKey());
      String value=StringUtils.trim((String)entry.getValue());
      if (key != null && key.startsWith(LICENSE_NAME_PROPERTY_PREFIX) && value != null) {
        String keyMinusPrefix=StringUtils.trimToNull(key.replace(LICENSE_NAME_PROPERTY_PREFIX,""));
        if (keyMinusPrefix != null) {
          String licenseText=StringUtils.trimToNull((properties.getProperty(LICENSE_TEXT_PROPERTY_PREFIX + keyMinusPrefix)));
          if (licenseText != null) {
            licenses.put(keyMinusPrefix,value);
            licenseTexts.put(keyMinusPrefix,licenseText);
          }
        }
 else {
          String error=LICENSES_PROPFILE_PATH + " has been been configured wrong.";
          LOG.error(error);
          throw new InvalidConfigException(InvalidConfigException.TYPE.INVALID_PROPERTIES_FILE,error);
        }
      }
    }
    if ((licenses.size() - 1) == 0) {
      String error="No licenses could be loaded from " + LICENSES_PROPFILE_PATH + ". Please check configuration.";
      LOG.error(error);
      throw new InvalidConfigException(InvalidConfigException.TYPE.INVALID_PROPERTIES_FILE,error);
    }
  }
}

@ Singleton public static synchronized void loadLicenseMaps ( String firstOption ) throws InvalidConfigException { if ( licenses == null || licenseTexts == null ) { licenses = new TreeMap < String , String > ( ) ; licenses . put ( "" , ( firstOption == null ) ? "-" : firstOption ) ; licenseTexts = new TreeMap < String , String > ( ) ; Properties properties = licenseProperties ( ) ; for ( Map . Entry < Object , Object > entry : properties . entrySet ( ) ) { String key = StringUtils . trim ( ( String ) entry . getKey ( ) ) ; String value = StringUtils . trim ( ( String ) entry . getValue ( ) ) ; if ( key != null && key . startsWith ( LICENSE_NAME_PROPERTY_PREFIX ) && value != null ) { String keyMinusPrefix = StringUtils . trimToNull ( key . replace ( LICENSE_NAME_PROPERTY_PREFIX , "" ) ) ; if ( keyMinusPrefix != null ) { String licenseText = StringUtils . trimToNull ( ( properties . getProperty ( LICENSE_TEXT_PROPERTY_PREFIX + keyMinusPrefix ) ) ) ; if ( licenseText != null ) { licenses . put ( keyMinusPrefix , value ) ; licenseTexts . put ( keyMinusPrefix , licenseText ) ; } } else { String error = LICENSES_PROPFILE_PATH + " has been been configured wrong." ; LOG . error ( error ) ; throw new InvalidConfigException ( InvalidConfigException . TYPE . INVALID_PROPERTIES_FILE , error ) ; } } } if ( ( licenses . size ( ) - 1 ) == 0 ) { String error = "No licenses could be loaded from " + LICENSES_PROPFILE_PATH + ". Please check configuration." ; LOG . error ( error ) ; throw new InvalidConfigException ( InvalidConfigException . TYPE . INVALID_PROPERTIES_FILE , error ) ; } } }
load license maps : # 1 ) license names - used to populate select on basic metadata page # 2 ) license texts - used to populate text area on basic metadata page
