Package org.eclipse.aether.internal.impl
Class DefaultOfflineController
- java.lang.Object
-
- org.eclipse.aether.internal.impl.DefaultOfflineController
-
- All Implemented Interfaces:
OfflineController
@Singleton @Named public class DefaultOfflineController extends java.lang.Object implements OfflineController
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCONFIG_PROP_OFFLINE_HOSTSComma-separated list of hosts which are supposed to be resolved when session is offline.static java.lang.StringCONFIG_PROP_OFFLINE_PROTOCOLSComma-separated list of protocols which are supposed to be resolved when session is offline.static java.lang.StringCONFIG_PROP_OFFLINE_REPOSITORIESComma-separated list of repository IDs which are supposed to be resolved when session is offline.
-
Constructor Summary
Constructors Constructor Description DefaultOfflineController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckOffline(org.eclipse.aether.RepositorySystemSession session, org.eclipse.aether.repository.RemoteRepository repository)Determines whether the specified repository is accessible if the system was in offline mode.
-
-
-
Field Detail
-
CONFIG_PROP_OFFLINE_PROTOCOLS
public static final java.lang.String CONFIG_PROP_OFFLINE_PROTOCOLS
Comma-separated list of protocols which are supposed to be resolved when session is offline.- See Also:
- Constant Field Values
-
CONFIG_PROP_OFFLINE_HOSTS
public static final java.lang.String CONFIG_PROP_OFFLINE_HOSTS
Comma-separated list of hosts which are supposed to be resolved when session is offline.- See Also:
- Constant Field Values
-
CONFIG_PROP_OFFLINE_REPOSITORIES
public static final java.lang.String CONFIG_PROP_OFFLINE_REPOSITORIES
Comma-separated list of repository IDs which are supposed to be resolved when session is offline.- Since:
- 2.0.8
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DefaultOfflineController
public DefaultOfflineController()
-
-
Method Detail
-
checkOffline
public void checkOffline(org.eclipse.aether.RepositorySystemSession session, org.eclipse.aether.repository.RemoteRepository repository) throws org.eclipse.aether.transfer.RepositoryOfflineException
Description copied from interface:OfflineControllerDetermines whether the specified repository is accessible if the system was in offline mode. A simple implementation might unconditionally throwRepositoryOfflineExceptionto block all remote repository access when in offline mode. More sophisticated implementations might inspectconfiguration propertiesof the session to check for some kind of whitelist that allows certain remote repositories even when offline. At any rate, the session's currentoffline stateis irrelevant to the outcome of the check.- Specified by:
checkOfflinein 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:
org.eclipse.aether.transfer.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()
-
-