public static boolean hasProperty ( final String propKey , final File propFile ) { if ( null == propKey ) throw new IllegalArgumentException ( "propKey param was null" ) ; if ( null == propFile ) throw new IllegalArgumentException ( "propFile param was null" ) ; if ( propFile . exists ( ) ) { final Properties p = new Properties ( ) ; try { FileInputStream fis = new FileInputStream ( propFile ) ; try { p . load ( fis ) ; } finally { if ( null != fis ) { fis . close ( ) ; } } return p . containsKey ( propKey ) ; } catch ( IOException e ) { return false ; } } else { return false ; } }
Reads propFile and then checks if specified key exists .