protected String addParameters( String path, RemoteRepository remoteRepository ) { if ( remoteRepository.getExtraParameters().isEmpty() ) { return path; } boolean question = false; StringBuilder res = new StringBuilder( path == null ? "" : path ); for ( Map.Entry<String, String> entry : remoteRepository.getExtraParameters().entrySet() ) { if ( !question ) { res.append( '?' ).append( entry.getKey() ).append( '=' ).append( entry.getValue() ); } } return res.toString(); } }
protected String addParameters( String path, RemoteRepository remoteRepository ) { if ( remoteRepository.getExtraParameters().isEmpty() ) { return path; } boolean question = false; StringBuilder res = new StringBuilder( path == null ? "" : path ); for ( Entry<String, String> entry : remoteRepository.getExtraParameters().entrySet() ) { if ( !question ) { res.append( '?' ).append( entry.getKey() ).append( '=' ).append( entry.getValue() ); } } return res.toString(); }
protected String addParameters( String path, RemoteRepository remoteRepository ) { if ( remoteRepository.getExtraParameters().isEmpty() ) { return path; } boolean question = false; StringBuilder res = new StringBuilder( path == null ? "" : path ); for ( Map.Entry<String, String> entry : remoteRepository.getExtraParameters().entrySet() ) { if ( !question ) { res.append( '?' ).append( entry.getKey() ).append( '=' ).append( entry.getValue() ); } } return res.toString(); }
protected String addParameters( String path, RemoteRepository remoteRepository ) { if ( remoteRepository.getExtraParameters( ).isEmpty( ) ) { return path; } boolean question = false; StringBuilder res = new StringBuilder( path == null ? "" : path ); for ( Map.Entry<String, String> entry : remoteRepository.getExtraParameters( ).entrySet( ) ) { if ( !question ) { res.append( '?' ).append( entry.getKey( ) ).append( '=' ).append( entry.getValue( ) ); } } return res.toString( ); }
cfg.setExtraParameters(remoteRepository.getExtraParameters()); cfg.setExtraHeaders(remoteRepository.getExtraHeaders()); cfg.setRefreshCronExpression(remoteRepository.getSchedulingDefinition());
@Override public RemoteRepositoryConfiguration getRemoteConfiguration( RemoteRepository remoteRepository ) { RemoteRepositoryConfiguration configuration = new RemoteRepositoryConfiguration( ); configuration.setId( remoteRepository.getId( ) ); configuration.setName( remoteRepository.getName( ) ); configuration.setDescription( remoteRepository.getDescription( ) ); configuration.setLayout( remoteRepository.getLayout( ) ); configuration.setRefreshCronExpression( remoteRepository.getSchedulingDefinition( ) ); configuration.setCheckPath( remoteRepository.getCheckPath( ) ); configuration.setExtraHeaders( remoteRepository.getExtraHeaders( ) ); configuration.setExtraParameters( remoteRepository.getExtraParameters( ) ); configuration.setTimeout( (int) remoteRepository.getTimeout( ).getSeconds( ) ); RepositoryCredentials creds = remoteRepository.getLoginCredentials( ); if (creds!=null) { PasswordCredentials pwdCreds = (PasswordCredentials) creds; configuration.setUsername( pwdCreds.getUsername( ) ); configuration.setPassword( new String( pwdCreds.getPassword( ) ) ); } configuration.setUrl( remoteRepository.getLocation( ) == null ? "" : remoteRepository.getLocation().toString( ) ); RemoteIndexFeature rif = remoteRepository.getFeature( RemoteIndexFeature.class ).get( ); configuration.setDownloadRemoteIndex( rif.isDownloadRemoteIndex( ) ); configuration.setDownloadRemoteIndexOnStartup( rif.isDownloadRemoteIndexOnStartup( ) ); configuration.setIndexDir( rif.getIndexUri( )==null ? "" : rif.getIndexUri().toString( ) ); configuration.setRemoteDownloadNetworkProxyId( rif.getProxyId( ) ); return configuration; }