public abstract class RemoteRepositoryFilterSourceSupport extends java.lang.Object implements RemoteRepositoryFilterSource
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.
Modifier and Type | Class and Description |
---|---|
protected static class |
RemoteRepositoryFilterSourceSupport.SimpleResult
Simple
RemoteRepositoryFilter.Result immutable implementation. |
Modifier and Type | Field and 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 |
Modifier | Constructor and Description |
---|---|
protected |
RemoteRepositoryFilterSourceSupport(java.lang.String name) |
Modifier and Type | Method and 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 common
DirectoryUtils.resolveDirectory(RepositorySystemSession, String, String, boolean) to
calculate (and maybe create) basedir for this implementation, never returns null . |
protected boolean |
isEnabled(RepositorySystemSession session)
Returns
true if session configuration contains this name set to true . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getRemoteRepositoryFilter
private static final java.lang.String CONFIG_PROP_PREFIX
private static final java.lang.String CONF_NAME_BASEDIR
static final java.lang.String LOCAL_REPO_PREFIX_DIR
private final java.lang.String name
protected RemoteRepositoryFilterSourceSupport(java.lang.String name)
protected java.lang.String configPropKey(java.lang.String name)
protected boolean isEnabled(RepositorySystemSession session)
true
if session configuration contains this name set to true
.
Default is false
.
protected java.nio.file.Path getBasedir(RepositorySystemSession session, boolean mayCreate)
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
.
Path
of basedir, never null
.