return value;
}
private RemoteRepositoryConfiguration readRemoteRepositoryConfiguration( String prefix, Registry registry )
{
RemoteRepositoryConfiguration value = new RemoteRepositoryConfiguration();
//String url = registry.getString( prefix + "url", value.getUrl() );
List<String> urlList = registry.getList( prefix + "url" );
String url = value.getUrl();
if (urlList != null && !urlList.isEmpty() )
{
StringBuilder sb = new StringBuilder( );
for (int i = 0,size = urlList.size();i<size;i++)
{
sb.append( urlList.get( i ) );
if (i<size - 1)
{
sb.append( ',' );
}
}
url = sb.toString();
}
value.setUrl( url );
//String username = registry.getString( prefix + "username", value.getUsername() );
List<String> usernameList = registry.getList( prefix + "username" );
String username = value.getUsername();
if (usernameList != null && !usernameList.isEmpty() )
{
StringBuilder sb = new StringBuilder( );
for (int i = 0,size = usernameList.size();i<size;i++)
{
sb.append( usernameList.get( i ) );
if (i<size - 1)
{
sb.append( ',' );
}
}
username = sb.toString();
}
value.setUsername( username );
//String password = registry.getString( prefix + "password", value.getPassword() );
List<String> passwordList = registry.getList( prefix + "password" );
String password = value.getPassword();
if (passwordList != null && !passwordList.isEmpty() )
{
StringBuilder sb = new StringBuilder( );
for (int i = 0,size = passwordList.size();i<size;i++)
{
sb.append( passwordList.get( i ) );
if (i<size - 1)
{
sb.append( ',' );
}
}
password = sb.toString();
}
value.setPassword( password );
int timeout = registry.getInt( prefix + "timeout", value.getTimeout() );
value.setTimeout( timeout );
//String refreshCronExpression = registry.getString( prefix + "refreshCronExpression", value.getRefreshCronExpression() );
List<String> refreshCronExpressionList = registry.getList( prefix + "refreshCronExpression" );
String refreshCronExpression = value.getRefreshCronExpression();
if (refreshCronExpressionList != null && !refreshCronExpressionList.isEmpty() )
{
StringBuilder sb = new StringBuilder( );
for (int i = 0,size = refreshCronExpressionList.size();i<size;i++)
{
sb.append( refreshCronExpressionList.get( i ) );
if (i<size - 1)
{
sb.append( ',' );
}
}
refreshCronExpression = sb.toString();
}
value.setRefreshCronExpression( refreshCronExpression );
boolean downloadRemoteIndex = registry.getBoolean( prefix + "downloadRemoteIndex", value.isDownloadRemoteIndex() );
value.setDownloadRemoteIndex( downloadRemoteIndex );
//String remoteIndexUrl = registry.getString( prefix + "remoteIndexUrl", value.getRemoteIndexUrl() );
List<String> remoteIndexUrlList = registry.getList( prefix + "remoteIndexUrl" );
String remoteIndexUrl = value.getRemoteIndexUrl();
if (remoteIndexUrlList != null && !remoteIndexUrlList.isEmpty() )
{
StringBuilder sb = new StringBuilder( );
for (int i = 0,size = remoteIndexUrlList.size();i<size;i++)
{
sb.append( remoteIndexUrlList.get( i ) );
if (i<size - 1)
{
sb.append( ',' );
}
}
remoteIndexUrl = sb.toString();
}
value.setRemoteIndexUrl( remoteIndexUrl );
//String remoteDownloadNetworkProxyId = registry.getString( prefix + "remoteDownloadNetworkProxyId", value.getRemoteDownloadNetworkProxyId() );
List<String> remoteDownloadNetworkProxyIdList = registry.getList( prefix + "remoteDownloadNetworkProxyId" );
String remoteDownloadNetworkProxyId = value.getRemoteDownloadNetworkProxyId();
if (remoteDownloadNetworkProxyIdList != null && !remoteDownloadNetworkProxyIdList.isEmpty() )
{
StringBuilder sb = new StringBuilder( );
for (int i = 0,size = remoteDownloadNetworkProxyIdList.size();i<size;i++)
{
sb.append( remoteDownloadNetworkProxyIdList.get( i ) );
if (i<size - 1)
{
sb.append( ',' );
}
}
remoteDownloadNetworkProxyId = sb.toString();
}
value.setRemoteDownloadNetworkProxyId( remoteDownloadNetworkProxyId );
int remoteDownloadTimeout = registry.getInt( prefix + "remoteDownloadTimeout", value.getRemoteDownloadTimeout() );
value.setRemoteDownloadTimeout( remoteDownloadTimeout );
boolean downloadRemoteIndexOnStartup = registry.getBoolean( prefix + "downloadRemoteIndexOnStartup", value.isDownloadRemoteIndexOnStartup() );
value.setDownloadRemoteIndexOnStartup( downloadRemoteIndexOnStartup );
java.util.Map extraParameters = registry.getProperties( prefix + "extraParameters" );
value.setExtraParameters( extraParameters );
java.util.Map extraHeaders = registry.getProperties( prefix + "extraHeaders" );
value.setExtraHeaders( extraHeaders );
//String id = registry.getString( prefix + "id", value.getId() );
List<String> idList = registry.getList( prefix + "id" );
String id = value.getId();
if (idList != null && !idList.isEmpty() )
{
StringBuilder sb = new StringBuilder( );
for (int i = 0,size = idList.size();i<size;i++)
{
sb.append( idList.get( i ) );
if (i<size - 1)
{
sb.append( ',' );
}
}
id = sb.toString();
}
value.setId( id );
//String name = registry.getString( prefix + "name", value.getName() );
List<String> nameList = registry.getList( prefix + "name" );
String name = value.getName();
if (nameList != null && !nameList.isEmpty() )
{
StringBuilder sb = new StringBuilder( );
for (int i = 0,size = nameList.size();i<size;i++)
{
sb.append( nameList.get( i ) );
if (i<size - 1)
{
sb.append( ',' );
}
}
name = sb.toString();
}
value.setName( name );
//String layout = registry.getString( prefix + "layout", value.getLayout() );
List<String> layoutList = registry.getList( prefix + "layout" );
String layout = value.getLayout();
if (layoutList != null && !layoutList.isEmpty() )
{
StringBuilder sb = new StringBuilder( );
for (int i = 0,size = layoutList.size();i<size;i++)
{
sb.append( layoutList.get( i ) );
if (i<size - 1)
{
sb.append( ',' );
}
}
layout = sb.toString();
}
value.setLayout( layout );
//String indexDir = registry.getString( prefix + "indexDir", value.getIndexDir() );
List<String> indexDirList = registry.getList( prefix + "indexDir" );
String indexDir = value.getIndexDir();
if (indexDirList != null && !indexDirList.isEmpty() )
{
StringBuilder sb = new StringBuilder( );
for (int i = 0,size = indexDirList.size();i<size;i++)
{
sb.append( indexDirList.get( i ) );
if (i<size - 1)
{
sb.append( ',' );
}
}
indexDir = sb.toString();
}
value.setIndexDir( indexDir );
//String description = registry.getString( prefix + "description", value.getDescription() );
List<String> descriptionList = registry.getList( prefix + "description" );
String description = value.getDescription();
if (descriptionList != null && !descriptionList.isEmpty() )
{
StringBuilder sb = new StringBuilder( );
for (int i = 0,size = descriptionList.size();i<size;i++)
{
sb.append( descriptionList.get( i ) );
if (i<size - 1)
{
sb.append( ',' );
}
}
description = sb.toString();
}
value.setDescription( description );
return value;
}