public class MavenRepositoryChartResolver extends AbstractChartResolver
AbstractChartResolver
capable of resolving Helm charts
from Maven repositories.resolve(String, String)
Constructor and Description |
---|
MavenRepositoryChartResolver(RepositorySystem repositorySystem,
RepositorySystemSession session,
List<RemoteRepository> remoteRepositories)
Creates a new
MavenRepositoryChartResolver . |
Modifier and Type | Method and Description |
---|---|
List<RemoteRepository> |
getRemoteRepositories()
Returns the
List of RemoteRepository instances
from which resolution will be attempted. |
RepositorySystem |
getRepositorySystem()
Returns the
RepositorySystem responsible for performing the
actual resolution. |
RepositorySystemSession |
getSession()
Returns the
RepositorySystemSession governing resolution. |
protected ChartOuterClass.Chart.Builder |
loadChart(File chartFile,
String packaging)
Returns a
ChartOuterClass.Chart.Builder
representing the Helm chart contained by the supplied regular File . |
ChartOuterClass.Chart.Builder |
resolve(Artifact chart)
Creates and returns a
ChartOuterClass.Chart.Builder representing a Helm
chart resolvable at the Maven repository coordinates represented
by the supplied Artifact . |
ChartOuterClass.Chart.Builder |
resolve(String coordinatesWithoutVersion,
String chartVersion)
Creates and returns a
ChartOuterClass.Chart.Builder representing a Helm
chart resolvable at the given Maven repository coordinates. |
public MavenRepositoryChartResolver(RepositorySystem repositorySystem, RepositorySystemSession session, List<RemoteRepository> remoteRepositories)
MavenRepositoryChartResolver
.repositorySystem
- the RepositorySystem
responsible
for performing the actual resolution; must not be null
repositorySystemSession
- the RepositorySystemSession
governing artifact resolution; must not
be null
remoteRepositories
- a List
of RemoteRepository
instances from which resolution will be
attempted; may be null
NullPointerException
- if repositorySystem
or
session
is null
getRepositorySystem()
,
getSession()
,
getRemoteRepositories()
public RepositorySystem getRepositorySystem()
RepositorySystem
responsible for performing the
actual resolution.
This method never returns null
.
Overrides of this method must not return null
.
RepositorySystem
responsible for performing the
actual resolution; never null
MavenRepositoryChartResolver(RepositorySystem,
RepositorySystemSession, List)
public RepositorySystemSession getSession()
RepositorySystemSession
governing resolution.
This method never returns null
.
Overrides of this method must not return null
.
RepositorySystemSession
governing resolution;
never null
MavenRepositoryChartResolver(RepositorySystem,
RepositorySystemSession, List)
public List<RemoteRepository> getRemoteRepositories()
List
of RemoteRepository
instances
from which resolution will be attempted.
This method may return null
.
Overrides of this method are permitted to return null
.
List
of RemoteRepository
instances
from which resolution will be attempted, or null
MavenRepositoryChartResolver(RepositorySystem,
RepositorySystemSession, List)
public final ChartOuterClass.Chart.Builder resolve(String coordinatesWithoutVersion, String chartVersion) throws ChartResolverException
ChartOuterClass.Chart.Builder
representing a Helm
chart resolvable at the given Maven repository coordinates.resolve
in class AbstractChartResolver
coordinatesWithoutVersion
- a String
of one of the
following forms: groupId:artifactId
, groupId:artifactId:packaging
, or groupId:artifactId:packaging:classifier
; must not be null
chartVersion
- the version of the Helm chart artifact to
resolve; may be null
in which case LATEST
will be
used insteadnull
ChartOuterClass.Chart.Builder
NullPointerException
- if coordinatesWithoutVersion
is null
ChartResolverException
- if coordinatesWithoutVersion
is malformed, if either the getRepositorySystem()
or getSession()
method returns
null
, if an ArtifactResolutionException
was
encountered during artifact resolution, or if the loadChart(File, String)
method throws a ChartResolverException
resolve(Artifact)
,
loadChart(File, String)
public ChartOuterClass.Chart.Builder resolve(Artifact chart) throws ChartResolverException
ChartOuterClass.Chart.Builder
representing a Helm
chart resolvable at the Maven repository coordinates represented
by the supplied Artifact
.
This method never returns null
.
Overrides of this method must not return null
.
chart
- the Artifact
representing the Helm chart to
resolve; must not be null
null
ChartOuterClass.Chart.Builder
NullPointerException
- if chart
is null
ChartResolverException
- if either the getRepositorySystem()
or getSession()
method returns
null
, if an ArtifactResolutionException
was
encountered during artifact resolution, or if the loadChart(File, String)
method throws a ChartResolverException
loadChart(File, String)
protected ChartOuterClass.Chart.Builder loadChart(File chartFile, String packaging) throws ChartResolverException
ChartOuterClass.Chart.Builder
representing the Helm chart contained by the supplied regular File
.
This method never returns null
.
Overrides of this method must not return null
.
This implementation will return a ChartOuterClass.Chart.Builder
provided that the
supplied File
is either a GZIP-encoded tape archive or a
ZIP archive. Overrides should feel free to expand these
capabilities.
chartFile
- the File
containing a Helm chart; must
not be null
packaging
- the kind of archive or other packaging mechanism
that the supplied chartFile
value is; must not be null
; examples include tgz
, tar.gz
, zip
and the like; overrides of this method may use this parameter to
help in determining how to read the supplied chartFile
null
ChartOuterClass.Chart.Builder
, usually but not
necessarily as produced by an AbstractChartLoader
implementationNullPointerException
- if chartFile
or packaging
is null
ChartResolverException
- if the chart could not be
loaded for any reasonresolve(String, String)
Copyright © 2017–2017, microBean. All rights reserved.