Class ArtifactManagerConfig
java.lang.Object
org.apache.sling.feature.io.artifacts.ArtifactManagerConfig
- All Implemented Interfaces:
ArtifactProviderContext
This class holds the configuration of artifact manager.
This class is not thread-safe.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongGet the number of cached artifacts@Nullable FileGet the cache directorylongGet the number of downloaded artifactslongGet the number of local artifacts@NotNull String[]Get the repository urls.voidInform about an artifact found in the cache.voidInform about an artifact being downloadedvoidInform about an artifact found locally.booleanisUseMvn()Should mvn be used if an artifact can't be found in the repositoriesvoidsetCacheDirectory(File dir) Set the cache directoryvoidsetRepositoryUrls(String[] urls) Set the repository urlsvoidsetUseMvn(boolean useMvn) Set whether mvn should be used to get artifacts.
-
Constructor Details
-
ArtifactManagerConfig
public ArtifactManagerConfig()Create a new configuration object. Set the default values
-
-
Method Details
-
setRepositoryUrls
Set the repository urls- Parameters:
urls- The repository urls
-
getRepositoryUrls
Get the repository urls. A repository url does not end with a slash.- Returns:
- The repository urls.
-
getCacheDirectory
Get the cache directory- Specified by:
getCacheDirectoryin interfaceArtifactProviderContext- Returns:
- The cache directory or
nullif none has been set
-
setCacheDirectory
Set the cache directory- Parameters:
dir- The cache directory
-
incCachedArtifacts
public void incCachedArtifacts()Description copied from interface:ArtifactProviderContextInform about an artifact found in the cache.- Specified by:
incCachedArtifactsin interfaceArtifactProviderContext
-
incDownloadedArtifacts
public void incDownloadedArtifacts()Description copied from interface:ArtifactProviderContextInform about an artifact being downloaded- Specified by:
incDownloadedArtifactsin interfaceArtifactProviderContext
-
incLocalArtifacts
public void incLocalArtifacts()Description copied from interface:ArtifactProviderContextInform about an artifact found locally.- Specified by:
incLocalArtifactsin interfaceArtifactProviderContext
-
getCachedArtifacts
public long getCachedArtifacts()Get the number of cached artifacts- Returns:
- The number of cached artifacts
-
getDownloadedArtifacts
public long getDownloadedArtifacts()Get the number of downloaded artifacts- Returns:
- The number of downloaded artifacts
-
getLocalArtifacts
public long getLocalArtifacts()Get the number of local artifacts- Returns:
- The number of local artifacts
-
isUseMvn
public boolean isUseMvn()Should mvn be used if an artifact can't be found in the repositories- Returns:
- Whether mvn command should be used.
- Since:
- 1.1.0
-
setUseMvn
public void setUseMvn(boolean useMvn) Set whether mvn should be used to get artifacts.- Parameters:
useMvn- flag for enabling mvn- Since:
- 1.1.0
-