public static List < String > getOrderList ( Properties repoProperties ) throws InstallException { List < String > orderList = new ArrayList < String > ( ) ; List < String > repoList = new ArrayList < String > ( ) ; // Retrieves the Repository Properties file File repoPropertiesFile = new File ( getRepoPropertiesFileLocation ( ) ) ; if ( repoPropertiesFile . exists ( ) && repoPropertiesFile . isFile ( ) ) { //Load repository properties FileInputStream repoPropertiesInput = null ; BufferedReader repoPropertiesReader = null ; try { repoPropertiesInput = new FileInputStream ( repoPropertiesFile ) ; repoPropertiesReader = new BufferedReader ( new InputStreamReader ( repoPropertiesInput ) ) ; String line ; String repoName ; while ( ( line = repoPropertiesReader . readLine ( ) ) != null ) { String keyValue [ ] = line . split ( EQUALS ) ; if ( ! line . startsWith ( COMMENT_PREFIX ) && keyValue . length > 1 && keyValue [ 0 ] . endsWith ( URL_SUFFIX ) ) { repoName = keyValue [ 0 ] . substring ( 0 , keyValue [ 0 ] . length ( ) - URL_SUFFIX . length ( ) ) ; //Ignore empty repository names if ( repoName . isEmpty ( ) ) { continue ; } //Remove duplicate entries if ( orderList . contains ( repoName ) ) { repoList . remove ( orderList . indexOf ( repoName ) ) ; orderList . remove ( repoName ) ; } orderList . add ( repoName ) ; repoList . add ( line ) ; // if Windows, replace \ to \\ if ( InstallUtils . isWindows && keyValue . length > 1 && keyValue [ 1 ] . contains ( "\\" ) ) { String url = repoProperties . getProperty ( keyValue [ 0 ] ) ; if ( url != null && ! InstallUtils . isURL ( url ) ) { repoProperties . put ( keyValue [ 0 ] , keyValue [ 1 ] . trim ( ) ) ; logger . log ( Level . FINEST , "The value of " + keyValue [ 0 ] + " was replaced to " + repoProperties . getProperty ( keyValue [ 0 ] ) ) ; } } } } } catch ( IOException e ) { throw new InstallException ( Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( "ERROR_TOOL_REPOSITORY_PROPS_NOT_LOADED" , getRepoPropertiesFileLocation ( ) ) , InstallException . IO_FAILURE ) ; } finally { InstallUtils . close ( repoPropertiesInput ) ; InstallUtils . close ( repoPropertiesReader ) ; } } if ( isWlpRepoEnabled ( repoProperties ) ) { orderList . add ( WLP_REPO ) ; } return orderList ; }
Compiles a list of repository names from a repository properties file removing duplicates and . url suffixes