public static List < RepositoryConfig > getRepositoryConfigs ( Properties repoProperties ) throws InstallException { List < String > orderList = getOrderList ( repoProperties ) ; List < RepositoryConfig > connections = new ArrayList < RepositoryConfig > ( orderList . size ( ) ) ; if ( repoProperties == null || repoProperties . isEmpty ( ) ) { connections . add ( new RepositoryConfig ( WLP_REPO , null , null , null , null ) ) ; return connections ; } for ( String r : orderList ) { if ( r . equalsIgnoreCase ( WLP_REPO ) ) { connections . add ( new RepositoryConfig ( WLP_REPO , null , null , null , null ) ) ; continue ; } String url = repoProperties . getProperty ( r + URL_SUFFIX ) ; String user = null ; String userPwd = null ; if ( url != null && ! url . isEmpty ( ) ) { user = repoProperties . getProperty ( r + USER_SUFFIX ) ; if ( user != null ) { if ( user . isEmpty ( ) ) user = null ; else { userPwd = repoProperties . getProperty ( r + PWD_SUFFIX ) ; if ( userPwd == null || userPwd . isEmpty ( ) ) { userPwd = repoProperties . getProperty ( r + USERPWD_SUFFIX ) ; } if ( userPwd != null && userPwd . isEmpty ( ) ) userPwd = null ; } } String apiKey = repoProperties . getProperty ( r + APIKEY_SUFFIX ) ; url = url . trim ( ) ; if ( ! InstallUtils . isURL ( url ) ) { File f = new File ( url ) ; try { url = f . toURI ( ) . toURL ( ) . toString ( ) ; } catch ( MalformedURLException e1 ) { logger . log ( Level . FINEST , "Failed to convert " + f . getAbsolutePath ( ) + " to url format" , e1 ) ; } } connections . add ( new RepositoryConfig ( r , url , apiKey , user , userPwd ) ) ; } } if ( connections . isEmpty ( ) ) { throw new InstallException ( Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( "ERROR_NO_REPO_WAS_ENABLED" ) ) ; } return connections ; }
Compiles a list of repository names from a repository properties file .