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 java.lang.Object implements org.eclipse.aether.spi.connector.filter.RemoteRepositoryFilterSource
Support class forRemoteRepositoryFilterSourceimplementations.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 enabledaether.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 java.lang.StringCONFIG_PROP_REPOSITORY_KEY_FUNCTIONExperimental: Configuration for "repository key" function.protected static java.lang.StringCONFIG_PROPS_PREFIXstatic java.lang.StringDEFAULT_REPOSITORY_KEY_FUNCTION
-
Constructor Summary
Constructors Modifier Constructor Description protectedRemoteRepositoryFilterSourceSupport(org.eclipse.aether.spi.remoterepo.RepositoryKeyFunctionFactory repositoryKeyFunctionFactory)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected java.nio.file.PathgetBasedir(org.eclipse.aether.RepositorySystemSession session, java.lang.String defaultValue, java.lang.String configPropKey, boolean mayCreate)Uses commonDirectoryUtils.resolveDirectory(RepositorySystemSession, String, String, boolean)to calculate (and maybe create) basedir for this implementation, never returnsnull.protected abstract booleanisEnabled(org.eclipse.aether.RepositorySystemSession session)Returnstrueif session configuration contains this name set totrue.protected org.eclipse.aether.repository.RemoteRepositorynormalizeRemoteRepository(org.eclipse.aether.RepositorySystemSession session, org.eclipse.aether.repository.RemoteRepository remoteRepository)We use remote repositories as keys, so normalize them.protected java.lang.StringrepositoryKey(org.eclipse.aether.RepositorySystemSession session, org.eclipse.aether.repository.RemoteRepository repository)Returns repository key to be used on file system layout.
-
-
-
Field Detail
-
CONFIG_PROPS_PREFIX
protected static final java.lang.String CONFIG_PROPS_PREFIX
- See Also:
- Constant Field Values
-
CONFIG_PROP_REPOSITORY_KEY_FUNCTION
public static final java.lang.String CONFIG_PROP_REPOSITORY_KEY_FUNCTION
Experimental: Configuration for "repository key" function. Note: repository key functions other than "nid" produce repository keys will be way different that those produced with previous versions or without this option enabled. Filter uses this key function to lay down and look up files to use in filtering.- Since:
- 2.0.14
- See Also:
- Constant Field Values
-
DEFAULT_REPOSITORY_KEY_FUNCTION
public static final java.lang.String DEFAULT_REPOSITORY_KEY_FUNCTION
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RemoteRepositoryFilterSourceSupport
protected RemoteRepositoryFilterSourceSupport(org.eclipse.aether.spi.remoterepo.RepositoryKeyFunctionFactory repositoryKeyFunctionFactory)
-
-
Method Detail
-
isEnabled
protected abstract boolean isEnabled(org.eclipse.aether.RepositorySystemSession session)
Returnstrueif session configuration contains this name set totrue.Default is
true.
-
getBasedir
protected java.nio.file.Path getBasedir(org.eclipse.aether.RepositorySystemSession session, java.lang.String defaultValue, java.lang.String configPropKey, boolean mayCreate)
Uses commonDirectoryUtils.resolveDirectory(RepositorySystemSession, String, String, boolean)to calculate (and maybe create) basedir for this implementation, never returnsnull. The returnedPathmay not exists, if invoked withmayCreatebeingfalse.Default value is
${LOCAL_REPOSITORY}/.checksums.- Returns:
- The
Pathof basedir, nevernull.
-
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 java.lang.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
-
-