Package org.eclipse.aether.internal.impl
Class DefaultOfflineController
- java.lang.Object
-
- org.eclipse.aether.internal.impl.DefaultOfflineController
-
- All Implemented Interfaces:
OfflineController
@Named public class DefaultOfflineController extends java.lang.Object implements OfflineController
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static java.lang.String
CONFIG_PROP_OFFLINE_HOSTS
(package private) static java.lang.String
CONFIG_PROP_OFFLINE_PROTOCOLS
private static java.util.regex.Pattern
SEP
-
Constructor Summary
Constructors Constructor Description DefaultOfflineController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkOffline(RepositorySystemSession session, RemoteRepository repository)
Determines whether the specified repository is accessible if the system was in offline mode.private java.lang.String[]
getConfig(RepositorySystemSession session, java.lang.String key)
private boolean
isOfflineHost(RepositorySystemSession session, RemoteRepository repository)
private boolean
isOfflineProtocol(RepositorySystemSession session, RemoteRepository repository)
-
-
-
Field Detail
-
CONFIG_PROP_OFFLINE_PROTOCOLS
static final java.lang.String CONFIG_PROP_OFFLINE_PROTOCOLS
- See Also:
- Constant Field Values
-
CONFIG_PROP_OFFLINE_HOSTS
static final java.lang.String CONFIG_PROP_OFFLINE_HOSTS
- See Also:
- Constant Field Values
-
SEP
private static final java.util.regex.Pattern SEP
-
-
Method Detail
-
checkOffline
public void checkOffline(RepositorySystemSession session, RemoteRepository repository) throws RepositoryOfflineException
Description copied from interface:OfflineController
Determines whether the specified repository is accessible if the system was in offline mode. A simple implementation might unconditionally throwRepositoryOfflineException
to block all remote repository access when in offline mode. More sophisticated implementations might inspectconfiguration properties
of the session to check for some kind of whitelist that allows certain remote repositories even when offline. At any rate, the session's currentoffline state
is irrelevant to the outcome of the check.- Specified by:
checkOffline
in interfaceOfflineController
- Parameters:
session
- The repository session during which the check is made, must not benull
.repository
- The remote repository to check for offline access, must not benull
.- Throws:
RepositoryOfflineException
- If the repository is not accessible in offline mode. If the method returns normally, the repository is considered accessible even in offline mode.- See Also:
RepositorySystemSession.isOffline()
-
isOfflineProtocol
private boolean isOfflineProtocol(RepositorySystemSession session, RemoteRepository repository)
-
isOfflineHost
private boolean isOfflineHost(RepositorySystemSession session, RemoteRepository repository)
-
getConfig
private java.lang.String[] getConfig(RepositorySystemSession session, java.lang.String key)
-
-