addons/httprox/common/src/main/java/org/commonjava/indy/httprox/util/ProxyResponseHelper.java
private String getRemoteRepositoryName( URL url ) throws IndyDataException
    {
        final String name = repoCreator.formatId( url.getHost(), getPort( url ), 0, null, StoreType.remote );

        logger.debug( "Looking for remote repo starts with name: {}", name );

        AbstractProxyRepositoryCreator abstractProxyRepositoryCreator = null;
        if ( repoCreator instanceof AbstractProxyRepositoryCreator )
        {
            abstractProxyRepositoryCreator = (AbstractProxyRepositoryCreator) repoCreator;
        }

        if ( abstractProxyRepositoryCreator == null )
        {
            return name;
        }

        Predicate<ArtifactStore> filter = abstractProxyRepositoryCreator.getNameFilter( name );
        List<String> l = storeManager.query()
                                     .packageType( GENERIC_PKG_KEY )
                                     .storeType( RemoteRepository.class )
                                     .stream( filter )
                                     .map( repository -> repository.getName() )
                                     .collect( Collectors.toList() );

        if ( l.isEmpty() )
        {
            return name;
        }
        return abstractProxyRepositoryCreator.getNextName( l );
    }
private String getRemoteRepositoryName( URL url ) throws IndyDataException
    {
        final String name = repoCreator.formatId( url.getHost(), getPort( url ), 0, null, StoreType.remote );

        logger.debug( "Looking for remote repo starts with name: {}", name );

        AbstractProxyRepositoryCreator abstractProxyRepositoryCreator = null;
        if ( repoCreator instanceof AbstractProxyRepositoryCreator )
        {
            abstractProxyRepositoryCreator = (AbstractProxyRepositoryCreator) repoCreator;
        }

        if ( abstractProxyRepositoryCreator == null )
        {
            return name;
        }

        Predicate<ArtifactStore> filter = abstractProxyRepositoryCreator.getNameFilter( name );
        List<String> l = storeManager.query()
                                     .packageType( GENERIC_PKG_KEY )
                                     .storeType( RemoteRepository.class )
                                     .stream( filter )
                                     .map( repository -> repository.getName() )
                                     .collect( Collectors.toList() );

        if ( l.isEmpty() )
        {
            return name;
        }
        return abstractProxyRepositoryCreator.getNextName( l );
    }
if repo with this name already exists, we need to use a different name