Class ArtifactManager
java.lang.Object
org.apache.sling.feature.io.artifacts.ArtifactManager
- All Implemented Interfaces:
AutoCloseable,ArtifactProvider
The artifact manager is the central service to get artifacts.
It uses
ArtifactProviders to get artifacts. The
providers are loaded using the service loader.-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()getArtifactHandler(String url) Get the full artifact url and file for an artifact.static ArtifactManagerGet an artifact manager based on the configurationprotected StringgetFileContents(ArtifactHandler handler) static StringgetLatestSnapshot(String mavenMetadata) static Stringprovide(ArtifactId id) Provide the artifact with the given id.voidshutdown()Shutdown the artifact manager.Return a feature provider based on this artifact manager
-
Method Details
-
getArtifactManager
Get an artifact manager based on the configuration- Parameters:
config- The configuration- Returns:
- The artifact manager
- Throws:
IOException- If the manager can't be initialized
-
shutdown
public void shutdown()Shutdown the artifact manager. -
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
provide
Description copied from interface:ArtifactProviderProvide the artifact with the given id.- Specified by:
providein interfaceArtifactProvider- Parameters:
id- The artifact id- Returns:
- The URL or
null
-
toFeatureProvider
Return a feature provider based on this artifact manager- Returns:
- A feature provider
- Since:
- 1.1.0
-
getArtifactHandler
Get the full artifact url and file for an artifact.- Parameters:
url- Artifact url or relative path.- Returns:
- Absolute url and file in the form of a handler.
- Throws:
IOException- If something goes wrong or the artifact can't be found.
-
getFileContents
- Throws:
IOException
-
getValue
-
getLatestSnapshot
-