public String getHttpRoleHint( final String hint ) { if ( isHttpProviderForced() || StringUtils.isBlank( hint ) ) { return getDefaultHttpRoleHint(); } else { return hint; } } }
public String getDefaultRoleHint( final String remoteUrl ) throws IllegalArgumentException { if ( StringUtils.isBlank( remoteUrl ) ) { throw new IllegalArgumentException( "Remote URL cannot be null!" ); } final String remoteUrlLowered = remoteUrl.toLowerCase(); if ( remoteUrlLowered.startsWith( "http:" ) || remoteUrlLowered.startsWith( "https:" ) ) { return getDefaultHttpRoleHint(); } throw new IllegalArgumentException( "No known remote repository storage provider for remote URL " + remoteUrl ); }
public String getRoleHint( final String remoteUrl, final String hint ) throws IllegalArgumentException { if ( StringUtils.isBlank( remoteUrl ) ) { throw new IllegalArgumentException( "Remote URL cannot be null!" ); } final String remoteUrlLowered = remoteUrl.toLowerCase(); if ( remoteUrlLowered.startsWith( "http:" ) || remoteUrlLowered.startsWith( "https:" ) ) { return getHttpRoleHint( hint ); } if ( StringUtils.isBlank( hint ) ) { throw new IllegalArgumentException( "RemoteRepositoryStorage hint cannot be null!" ); } logger.debug( "Returning supplied \"{}\" hint for remote URL {}.", remoteUrl, hint ); return hint; }
protected synchronized boolean isHttpProviderForced() { if ( httpProviderForced == null ) { httpProviderForced = SystemPropertiesHelper.getBoolean( DEFAULT_HTTP_PROVIDER_FORCED_KEY, false ); if ( httpProviderForced ) { logger.warn( "HTTP Provider forcing is in effect (system property \"" + DEFAULT_HTTP_PROVIDER_FORCED_KEY + "\" is set to \"true\"!), so regardless of your configuration, for HTTP RemoteRepositoryStorage the \"" + getDefaultHttpRoleHint() + "\" provider will be used! Consider adjusting your configuration instead and stop using provider forcing." ); } } return httpProviderForced; }