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
ArtifactProvider
s to get artifacts. The
providers are loaded using the service loader.-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
getArtifactHandler
(String url) Get the full artifact url and file for an artifact.static ArtifactManager
Get an artifact manager based on the configurationprotected String
getFileContents
(ArtifactHandler handler) static String
getLatestSnapshot
(String mavenMetadata) static String
provide
(ArtifactId id) Provide the artifact with the given id.void
shutdown()
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:
close
in interfaceAutoCloseable
-
provide
Description copied from interface:ArtifactProvider
Provide the artifact with the given id.- Specified by:
provide
in 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
-