private Map<String,String> loadDCATPrefixes(){
  HashMap<String,String> prefixes=new HashMap<String,String>();
  Closer closer=Closer.create();
  try {
    InputStreamUtils streamUtils=new InputStreamUtils();
    InputStream configStream=streamUtils.classpathStream(PREFIXES_PROPERTIES);
    if (configStream == null) {
      LOG.error("Could not load DCAT prefixes from file: " + PREFIXES_PROPERTIES);
    }
 else {
      Properties properties=new Properties();
      properties.load(configStream);
      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 && value != null) {
          prefixes.put(key,value);
        }
 else {
          throw new InvalidConfigException(InvalidConfigException.TYPE.INVALID_PROPERTIES_FILE,"Invalid properties file: " + PREFIXES_PROPERTIES);
        }
      }
      LOG.debug("Loaded DCAT prefixes: " + prefixes.toString());
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
 finally {
    try {
      closer.close();
    }
 catch (    IOException e) {
      LOG.error("Failed to close input stream on DCAT prefixes file: " + PREFIXES_PROPERTIES);
    }
  }
  return prefixes;
}

private Map < String , String > loadDCATPrefixes ( ) { HashMap < String , String > prefixes = new HashMap < String , String > ( ) ; Closer closer = Closer . create ( ) ; try { InputStreamUtils streamUtils = new InputStreamUtils ( ) ; InputStream configStream = streamUtils . classpathStream ( PREFIXES_PROPERTIES ) ; if ( configStream == null ) { LOG . error ( "Could not load DCAT prefixes from file: " + PREFIXES_PROPERTIES ) ; } else { Properties properties = new Properties ( ) ; properties . load ( configStream ) ; 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 && value != null ) { prefixes . put ( key , value ) ; } else { throw new InvalidConfigException ( InvalidConfigException . TYPE . INVALID_PROPERTIES_FILE , "Invalid properties file: " + PREFIXES_PROPERTIES ) ; } } LOG . debug ( "Loaded DCAT prefixes: " + prefixes . toString ( ) ) ; } } catch ( Exception e ) { e . printStackTrace ( ) ; } finally { try { closer . close ( ) ; } catch ( IOException e ) { LOG . error ( "Failed to close input stream on DCAT prefixes file: " + PREFIXES_PROPERTIES ) ; } } return prefixes ; }
this method loads the dcat prefixes from dcat . properties .
