public static String getApiClient ( final Class < ? > apiClass , final String fileName , final String defaultClientName ) { InputStream propertiesStream = null ; try { propertiesStream = apiClass . getResourceAsStream ( fileName ) ; if ( propertiesStream != null ) { Properties props = new Properties ( ) ; props . load ( propertiesStream ) ; String name = ( String ) props . get ( "api-client.name" ) ; String version = ( String ) props . get ( "api-client.version" ) ; return name + "-" + version ; } } catch ( Throwable t ) { LOGGER . error ( "Exception reading {} configuration file" , fileName , t ) ; } finally { if ( propertiesStream != null ) { try { propertiesStream . close ( ) ; } catch ( Throwable t ) { LOGGER . info ( "Exception closing {} configuration file" , fileName , t ) ; } } } return defaultClientName ; }
Gets the client name from the properties file