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 java.lang.Object implements RemoteRepositoryFilterSource
Support class forRemoteRepositoryFilterSource
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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
RemoteRepositoryFilterSourceSupport.SimpleResult
SimpleRemoteRepositoryFilter.Result
immutable implementation.
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
CONF_NAME_BASEDIR
private static java.lang.String
CONFIG_PROP_PREFIX
(package private) static java.lang.String
LOCAL_REPO_PREFIX_DIR
private java.lang.String
name
-
Constructor Summary
Constructors Modifier Constructor Description protected
RemoteRepositoryFilterSourceSupport(java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String
configPropKey(java.lang.String name)
Utility method to create scoped configuration property key of given name.protected java.nio.file.Path
getBasedir(RepositorySystemSession session, boolean mayCreate)
Uses commonDirectoryUtils.resolveDirectory(RepositorySystemSession, String, String, boolean)
to calculate (and maybe create) basedir for this implementation, never returnsnull
.protected boolean
isEnabled(RepositorySystemSession session)
Returnstrue
if session configuration contains this name set totrue
.-
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 Detail
-
CONFIG_PROP_PREFIX
private static final java.lang.String CONFIG_PROP_PREFIX
- See Also:
- Constant Field Values
-
CONF_NAME_BASEDIR
private static final java.lang.String CONF_NAME_BASEDIR
- See Also:
- Constant Field Values
-
LOCAL_REPO_PREFIX_DIR
static final java.lang.String LOCAL_REPO_PREFIX_DIR
- See Also:
- Constant Field Values
-
name
private final java.lang.String name
-
-
Method Detail
-
configPropKey
protected java.lang.String configPropKey(java.lang.String name)
Utility method to create scoped configuration property key of given name.
-
isEnabled
protected boolean isEnabled(RepositorySystemSession session)
Returnstrue
if session configuration contains this name set totrue
.Default is
false
.
-
getBasedir
protected java.nio.file.Path getBasedir(RepositorySystemSession session, boolean mayCreate)
Uses commonDirectoryUtils.resolveDirectory(RepositorySystemSession, String, String, boolean)
to calculate (and maybe create) basedir for this implementation, never returnsnull
. The returnedPath
may not exists, if invoked withmayCreate
beingfalse
.Default value is
${LOCAL_REPOSITORY}/.checksums
.- Returns:
- The
Path
of basedir, nevernull
.
-
-