private static Properties loadGradleProperties ( FilePath gradlePropertiesFilePath ) throws IOException , InterruptedException { return gradlePropertiesFilePath . act ( new MasterToSlaveFileCallable < Properties > ( ) { public Properties invoke ( File gradlePropertiesFile , VirtualChannel channel ) throws IOException , InterruptedException { Properties gradleProps = new Properties ( ) ; if ( gradlePropertiesFile . exists ( ) ) { debuggingLogger . fine ( "Gradle properties file exists at: " + gradlePropertiesFile . getAbsolutePath ( ) ) ; FileInputStream stream = null ; try { stream = new FileInputStream ( gradlePropertiesFile ) ; gradleProps . load ( stream ) ; } catch ( IOException e ) { debuggingLogger . fine ( "IO exception occurred while trying to read properties file from: " + gradlePropertiesFile . getAbsolutePath ( ) ) ; throw new RuntimeException ( e ) ; } finally { IOUtils . closeQuietly ( stream ) ; } } return gradleProps ; } } ) ; }
Load a properties file from a file path