public String getRemoteUrl() { if ( getCurrentConfiguration( false ).getRemoteStorage() != null ) { return getCurrentConfiguration( false ).getRemoteStorage().getUrl(); } else { return null; } }
protected void doForceNfcSetting( final Configuration configuration ) { getLogger().info( "Enforcing proper NFC use: every non-proxy repository present in system will have NFC deactivated (system property override present)." ); // conservatively shut down NFC on any non-proxy repository for ( CRepository repository : configuration.getRepositories() ) { final boolean isProxyRepository = repository.getRemoteStorage() != null && repository.getRemoteStorage().getUrl() != null; repository.setNotFoundCacheActive( isProxyRepository ); } }
public List<Mirror> getMirrors() { List<CMirror> modelMirrors = getConfiguration( false ).getRemoteStorage().getMirrors(); List<Mirror> mirrors = new ArrayList<Mirror>( modelMirrors.size() ); for ( CMirror model : modelMirrors ) { Mirror mirror = new Mirror( model.getId(), model.getUrl() ); mirrors.add( mirror ); } return Collections.unmodifiableList( mirrors ); }
protected boolean existsMirrorWithId( boolean forWrite, String id ) { List<CMirror> modelMirrors = getConfiguration( forWrite ).getRemoteStorage().getMirrors(); for ( CMirror modelMirror : modelMirrors ) { if ( modelMirror.getId().equals( id ) ) { return true; } } return false; } }
@Override protected void copyTransients( Object source, Object destination ) { ( (CRepository) destination ).setExternalConfiguration( ( (CRepository) source ).getExternalConfiguration() ); ( (CRepository) destination ).externalConfigurationImple = ( (CRepository) source ).externalConfigurationImple; ( (CRepository) destination ).defaultLocalStorageUrl = ( (CRepository) source ).defaultLocalStorageUrl; // trick with RemoteStorage, which is an object, and XStream will not "overlap" it properly (ie. destionation != // null but source == null) if ( ( (CRepository) source ).getRemoteStorage() == null ) { ( (CRepository) destination ).setRemoteStorage( null ); } }
public void setMirrors( List<Mirror> mirrors ) { if ( mirrors == null || mirrors.isEmpty() ) { getConfiguration( true ).getRemoteStorage().getMirrors().clear(); blacklist.clear(); } else { List<CMirror> modelMirrors = new ArrayList<CMirror>( mirrors.size() ); for ( Mirror mirror : mirrors ) { CMirror model = new CMirror(); model.setId( mirror.getId() ); model.setUrl( mirror.getUrl() ); modelMirrors.add( model ); } getConfiguration( true ).getRemoteStorage().setMirrors( modelMirrors ); // remove blacklist entries for removed mirrors, but retain others Iterator<Entry<String, BlacklistEntry>> i = blacklist.entrySet().iterator(); while ( i.hasNext() ) { String id = i.next().getKey(); if ( !existsMirrorWithId( true, id ) ) { i.remove(); } } } }
public void setRemoteUrl( String remoteUrl ) throws RemoteStorageException { if ( getRemoteStorage() != null ) { String newRemoteUrl = remoteUrl.trim(); String oldRemoteUrl = getRemoteUrl(); if ( !newRemoteUrl.endsWith( RepositoryItemUid.PATH_SEPARATOR ) ) { newRemoteUrl = newRemoteUrl + RepositoryItemUid.PATH_SEPARATOR; } getRemoteStorage().validateStorageUrl( newRemoteUrl ); getCurrentConfiguration( true ).getRemoteStorage().setUrl( newRemoteUrl ); if ( ( StringUtils.isEmpty( oldRemoteUrl ) && StringUtils.isNotEmpty( newRemoteUrl ) ) || ( StringUtils.isNotEmpty( oldRemoteUrl ) && !oldRemoteUrl.equals( newRemoteUrl ) ) ) { this.remoteUrlChanged = true; } } else { throw new RemoteStorageException( "No remote storage set on repository \"" + getName() + "\" (ID=\"" + getId() + "\"), cannot set remoteUrl!" ); } }
public void setRemoteStorage( RemoteRepositoryStorage remoteStorage ) { this.remoteStorage = remoteStorage; if ( remoteStorage == null ) { getCurrentConfiguration( true ).setRemoteStorage( null ); } else { if ( getCurrentConfiguration( true ).getRemoteStorage() == null ) { getCurrentConfiguration( true ).setRemoteStorage( new CRemoteStorage() ); } getCurrentConfiguration( true ).getRemoteStorage().setProvider( remoteStorage.getProviderId() ); setWritePolicy( RepositoryWritePolicy.READ_ONLY ); } }
if ( repo.getRemoteStorage() != null && repo.getRemoteStorage().getAuthentication() != null && StringUtils.isNotEmpty( repo.getRemoteStorage().getAuthentication().getPassword() ) ) CRemoteAuthentication auth = repo.getRemoteStorage().getAuthentication(); auth.setPassword( encryptDecryptPassword( auth.getPassword(), encrypt, mask ) ); if ( repo.getRemoteStorage() != null && repo.getRemoteStorage().getHttpProxySettings() != null && repo.getRemoteStorage().getHttpProxySettings().getAuthentication() != null && StringUtils.isNotEmpty( repo.getRemoteStorage().getHttpProxySettings().getAuthentication().getPassword() ) ) CRemoteAuthentication auth = repo.getRemoteStorage().getHttpProxySettings().getAuthentication(); auth.setPassword( encryptDecryptPassword( auth.getPassword(), encrypt, mask ) );
Assert.assertNull( cRepo.getRemoteStorage() ); .getRemoteStorage().getUrl() );
if ( target.getRemoteStorage() == null ) target.getRemoteStorage().setUrl( model.getRemoteStorage().getRemoteStorageUrl() ); target.getRemoteStorage().setAuthentication( this.convertAuthentication( model.getRemoteStorage().getAuthentication(), null ) ); target.getRemoteStorage().setConnectionSettings( this.convertRemoteConnectionSettings( model.getRemoteStorage().getConnectionSettings() ) ); target.getRemoteStorage().setHttpProxySettings( this.convertHttpProxySettings( model.getRemoteStorage().getHttpProxySettings(), null ) );
.getRemoteStorage().getAuthentication())); .getRemoteStorage().getConnectionSettings()));
.getRemoteStorage().getAuthentication() ) ); resource.getRemoteStorage().setConnectionSettings( AbstractGlobalConfigurationPlexusResource.convert( NexusCompat.getRepositoryRawConfiguration( repository ) .getRemoteStorage().getConnectionSettings() ) ); resource.getRemoteStorage().setHttpProxySettings( AbstractGlobalConfigurationPlexusResource.convert( NexusCompat.getRepositoryRawConfiguration( repository ) .getRemoteStorage().getHttpProxySettings() ) );
if (target.getRemoteStorage() == null) { target.setRemoteStorage(new CRemoteStorage()); target.getRemoteStorage().setUrl(model.getRemoteStorage().getRemoteStorageUrl()); target.getRemoteStorage().setAuthentication( this.convertAuthentication(model.getRemoteStorage().getAuthentication(), null)); target.getRemoteStorage().setConnectionSettings( this.convertRemoteConnectionSettings(model.getRemoteStorage().getConnectionSettings()));
repo.getRemoteStorage().setProvider( getTemplateProvider().getRemoteProviderHintFactory().getDefaultHttpRoleHint()); repo.getRemoteStorage().setUrl("http://some-remote-repository/repo-root");
repo.getRemoteStorage().setProvider(getTemplateProvider().getRemoteProviderHintFactory().getDefaultHttpRoleHint()); repo.getRemoteStorage().setUrl("http://some-remote-repository/repo-root");
repo.getRemoteStorage().setProvider(getTemplateProvider().getRemoteProviderHintFactory().getDefaultHttpRoleHint()); repo.getRemoteStorage().setUrl("http://some-remote-repository/repo-root");
repo.getRemoteStorage().setProvider( getTemplateProvider().getRemoteProviderHintFactory().getDefaultHttpRoleHint() ); repo.getRemoteStorage().setUrl( "http://some-remote-repository/repo-root" );
repo.getRemoteStorage().setProvider( getTemplateProvider().getRemoteProviderHintFactory().getDefaultHttpRoleHint() ); repo.getRemoteStorage().setUrl( "http://some-remote-repository/repo-root" );
Assert.assertNull(cRepo.getRemoteStorage()); Assert.assertEquals(cRepo.getRemoteStorage().getUrl(), expected.getRemoteStorage().getRemoteStorageUrl());