Class RemoteRepositoryFilterSourceSupport
java.lang.Object
org.eclipse.aether.internal.impl.filter.RemoteRepositoryFilterSourceSupport
- All Implemented Interfaces:
RemoteRepositoryFilterSource
- Direct Known Subclasses:
GroupIdRemoteRepositoryFilterSource,PrefixesRemoteRepositoryFilterSource
public abstract class RemoteRepositoryFilterSourceSupport
extends Object
implements 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 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 -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedRemoteRepositoryFilterSourceSupport(RepositoryKeyFunctionFactory repositoryKeyFunctionFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected PathgetBasedir(RepositorySystemSession session, String defaultValue, 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(RepositorySystemSession session) Returnstrueif session configuration contains this name set totrue.protected RemoteRepositorynormalizeRemoteRepository(RepositorySystemSession session, RemoteRepository remoteRepository) We use remote repositories as keys, so normalize them.protected StringrepositoryKey(RepositorySystemSession session, 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, waitMethods inherited from interface org.eclipse.aether.spi.connector.filter.RemoteRepositoryFilterSource
getRemoteRepositoryFilter
-
Field Details
-
CONFIG_PROPS_PREFIX
- See Also:
-
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:
- Sourced from:
RepositorySystemSession.getConfigProperties()- Value type:
String- Default value:
DEFAULT_REPOSITORY_KEY_FUNCTION
-
DEFAULT_REPOSITORY_KEY_FUNCTION
- See Also:
-
-
Constructor Details
-
RemoteRepositoryFilterSourceSupport
protected RemoteRepositoryFilterSourceSupport(RepositoryKeyFunctionFactory repositoryKeyFunctionFactory)
-
-
Method Details
-
isEnabled
Returnstrueif session configuration contains this name set totrue.Default is
true. -
getBasedir
protected Path getBasedir(RepositorySystemSession session, String defaultValue, 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 RemoteRepository normalizeRemoteRepository(RepositorySystemSession session, RemoteRepository remoteRepository) We use remote repositories as keys, so normalize them.- Since:
- 2.0.14
- See Also:
-
repositoryKey
Returns repository key to be used on file system layout.- Since:
- 2.0.14
-