Class RemoteRepositoryFilterSourceSupport

java.lang.Object
org.eclipse.aether.internal.impl.filter.RemoteRepositoryFilterSourceSupport
All Implemented Interfaces:
org.eclipse.aether.spi.connector.filter.RemoteRepositoryFilterSource
Direct Known Subclasses:
GroupIdRemoteRepositoryFilterSource, PrefixesRemoteRepositoryFilterSource

public abstract class RemoteRepositoryFilterSourceSupport extends Object implements org.eclipse.aether.spi.connector.filter.RemoteRepositoryFilterSource
Support class for RemoteRepositoryFilterSource implementations.

Support class for implementing RemoteRepositoryFilterSource. It implements basic support like optional "basedir" calculation, handling of "enabled" flag.

The configuration keys supported:

  • aether.remoteRepositoryFilter.${id}.enabled
    (boolean) must be explicitly set to "true" to become enabled
  • aether.remoteRepositoryFilter.${id}.basedir
    (string, path) directory from where implementation can use files. If unset, default value is ".remoteRepositoryFilters/${id}" and is resolved from local repository basedir.
Since:
1.9.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Experimental: Configuration for "repository key" function.
    protected static final String
     
    static final String
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    RemoteRepositoryFilterSourceSupport(org.eclipse.aether.spi.remoterepo.RepositoryKeyFunctionFactory repositoryKeyFunctionFactory)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected Path
    getBasedir(org.eclipse.aether.RepositorySystemSession session, String defaultValue, String configPropKey, boolean mayCreate)
    Uses common DirectoryUtils.resolveDirectory(RepositorySystemSession, String, String, boolean) to calculate (and maybe create) basedir for this implementation, never returns null.
    protected abstract boolean
    isEnabled(org.eclipse.aether.RepositorySystemSession session)
    Returns true if session configuration contains this name set to true.
    protected org.eclipse.aether.repository.RemoteRepository
    normalizeRemoteRepository(org.eclipse.aether.RepositorySystemSession session, org.eclipse.aether.repository.RemoteRepository remoteRepository)
    We use remote repositories as keys, so normalize them.
    protected String
    repositoryKey(org.eclipse.aether.RepositorySystemSession session, org.eclipse.aether.repository.RemoteRepository repository)
    Returns repository key to be used on file system layout.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.eclipse.aether.spi.connector.filter.RemoteRepositoryFilterSource

    getRemoteRepositoryFilter
  • Field Details

  • Constructor Details

    • RemoteRepositoryFilterSourceSupport

      protected RemoteRepositoryFilterSourceSupport(org.eclipse.aether.spi.remoterepo.RepositoryKeyFunctionFactory repositoryKeyFunctionFactory)
  • Method Details

    • isEnabled

      protected abstract boolean isEnabled(org.eclipse.aether.RepositorySystemSession session)
      Returns true if session configuration contains this name set to true.

      Default is true.

    • getBasedir

      protected Path getBasedir(org.eclipse.aether.RepositorySystemSession session, String defaultValue, String configPropKey, boolean mayCreate)
      Uses common DirectoryUtils.resolveDirectory(RepositorySystemSession, String, String, boolean) to calculate (and maybe create) basedir for this implementation, never returns null. The returned Path may not exists, if invoked with mayCreate being false.

      Default value is ${LOCAL_REPOSITORY}/.checksums.

      Returns:
      The Path of basedir, never null.
    • normalizeRemoteRepository

      protected org.eclipse.aether.repository.RemoteRepository normalizeRemoteRepository(org.eclipse.aether.RepositorySystemSession session, org.eclipse.aether.repository.RemoteRepository remoteRepository)
      We use remote repositories as keys, so normalize them.
      Since:
      2.0.14
      See Also:
      • RemoteRepository.toBareRemoteRepository()
    • repositoryKey

      protected String repositoryKey(org.eclipse.aether.RepositorySystemSession session, org.eclipse.aether.repository.RemoteRepository repository)
      Returns repository key to be used on file system layout.
      Since:
      2.0.14