public static Properties loadRepoProperties ( ) throws InstallException { Properties repoProperties = null ; // Retrieves the Repository Properties file File repoPropertiesFile = new File ( getRepoPropertiesFileLocation ( ) ) ; //Check if default repository properties file location is overridden boolean isPropsLocationOverridden = System . getProperty ( InstallConstants . OVERRIDE_PROPS_LOCATION_ENV_VAR ) != null ? true : false ; if ( repoPropertiesFile . exists ( ) && repoPropertiesFile . isFile ( ) ) { //Load repository properties repoProperties = new Properties ( ) ; FileInputStream repoPropertiesInput = null ; try { repoPropertiesInput = new FileInputStream ( repoPropertiesFile ) ; repoProperties . load ( repoPropertiesInput ) ; } catch ( Exception e ) { throw new InstallException ( Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( "ERROR_TOOL_REPOSITORY_PROPS_NOT_LOADED" , getRepoPropertiesFileLocation ( ) ) , InstallException . IO_FAILURE ) ; } finally { InstallUtils . close ( repoPropertiesInput ) ; } } else if ( isPropsLocationOverridden ) { //Checks if the override location is a directory throw new InstallException ( Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( repoPropertiesFile . isDirectory ( ) ? "ERROR_TOOL_REPOSITORY_PROPS_NOT_FILE" : "ERROR_TOOL_REPOSITORY_PROPS_NOT_EXISTS" , getRepoPropertiesFileLocation ( ) ) , InstallException . IO_FAILURE ) ; } return repoProperties ; }
Loads the repository properties into a Properties object