Package org.apache.ivy.plugins.resolver
Class RepositoryResolver
- java.lang.Object
-
- org.apache.ivy.plugins.resolver.AbstractResolver
-
- org.apache.ivy.plugins.resolver.BasicResolver
-
- org.apache.ivy.plugins.resolver.AbstractPatternsBasedResolver
-
- org.apache.ivy.plugins.resolver.RepositoryResolver
-
- All Implemented Interfaces:
Validatable
,DependencyResolver
,HasLatestStrategy
- Direct Known Subclasses:
FileSystemResolver
,JarResolver
,MirroredURLResolver
,URLResolver
,VsftpResolver
public class RepositoryResolver extends AbstractPatternsBasedResolver
-
-
Field Summary
-
Fields inherited from class org.apache.ivy.plugins.resolver.BasicResolver
DATE_FORMAT, DESCRIPTOR_OPTIONAL, DESCRIPTOR_REQUIRED
-
-
Constructor Summary
Constructors Constructor Description RepositoryResolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DownloadReport
download(Artifact[] artifacts, DownloadOptions options)
Download artifacts with specified DownloadOptions.void
dumpSettings()
protected boolean
exist(java.lang.String path)
protected ResolvedResource
findResourceUsingPattern(ModuleRevisionId mrid, java.lang.String pattern, Artifact artifact, ResourceMDParser rmdparser, java.util.Date date)
protected void
findTokenValues(java.util.Collection<java.lang.String> names, java.util.List<java.lang.String> patterns, java.util.Map<java.lang.String,java.lang.String> tokenValues, java.lang.String token)
protected long
get(Resource resource, java.io.File dest)
protected java.lang.String
getDestination(java.lang.String pattern, Artifact artifact, ModuleRevisionId mrid)
Repository
getRepository()
protected Resource
getResource(java.lang.String source)
java.lang.String
getTypeName()
boolean
isAlwaysCheckExactRevision()
protected ResolvedResource[]
listResources(Repository repository, ModuleRevisionId mrid, java.lang.String pattern, Artifact artifact)
List all revisions as resolved resources for the given artifact in the given repository using the given pattern, and using the given mrid except its revision.protected java.lang.String[]
listTokenValues(java.lang.String pattern, java.lang.String token)
void
publish(Artifact artifact, java.io.File src, boolean overwrite)
protected void
put(Artifact artifact, java.io.File src, java.lang.String dest, boolean overwrite)
protected void
putChecksum(Artifact artifact, java.io.File src, java.lang.String dest, boolean overwrite, java.lang.String algorithm)
protected void
putSignature(Artifact artifact, java.io.File src, java.lang.String dest, boolean overwrite)
void
setAlwaysCheckExactRevision(boolean alwaysCheckExactRevision)
void
setName(java.lang.String name)
Should only be used by configuratorvoid
setRepository(Repository repository)
void
setSettings(ResolverSettings settings)
void
setSigner(java.lang.String signerName)
-
Methods inherited from class org.apache.ivy.plugins.resolver.AbstractPatternsBasedResolver
addArtifactPattern, addConfiguredArtifact, addConfiguredIvy, addIvyPattern, convertM2CriteriaForResourceSearch, convertM2IdForResourceSearch, convertM2OrganizationForResourceSearch, convertM2ResourceSearchIdToNormal, convertM2TokenValuesForResourceSearch, findArtifactNames, findArtifactRef, findIvyFileRef, findIvyNames, findNames, findResource, findResourceUsingPatterns, getArtifactPatterns, getIvyPatterns, getModuleDescriptorExtension, isM2compatible, listTokenValues, setArtifactPatterns, setIvyPatterns, setM2compatible
-
Methods inherited from class org.apache.ivy.plugins.resolver.BasicResolver
acceptLatest, checkModuleDescriptorRevision, clearArtifactAttempts, clearIvyAttempts, doFindArtifactRef, download, exists, filterNames, findFirstArtifactRef, getAndCheck, getArtifactRef, getChecksumAlgorithms, getDefaultRMDParser, getDependency, getPublicationDate, getRMDParser, getWorkspaceName, isAllownomd, isCheckconsistency, isEnvDependent, isForce, listModules, listOrganisations, listRevisions, listTokenValues, locate, logArtifactAttempt, logAttempt, logIvyAttempt, parse, reportFailure, reportFailure, setAllownomd, setCheckconsistency, setChecksums, setDescriptor, setEnvDependent, setForce, setWorkspaceName, shouldReturnResolvedModule, toString
-
Methods inherited from class org.apache.ivy.plugins.resolver.AbstractResolver
abortPublishTransaction, beginPublishTransaction, checkInterrupted, checkLatest, commitPublishTransaction, doValidate, findModuleInCache, findModuleInCache, fromSystem, fromSystem, getCacheDownloadOptions, getCacheOptions, getChangingMatcherName, getChangingPattern, getDownloadOptions, getEventManager, getLatest, getLatestStrategy, getName, getNamespace, getParserSettings, getRepositoryCacheManager, getSettings, getSystemNode, getTimeoutConstraint, hidePassword, isAfter, isValidate, saveModuleRevisionIfNeeded, setCache, setChangingMatcher, setChangingPattern, setCheckmodified, setEventManager, setLatest, setLatestStrategy, setNamespace, setRepositoryCacheManager, setTimeoutConstraint, setValidate, toSystem, toSystem, toSystem, toSystem, toSystem, toSystem, validate
-
-
-
-
Method Detail
-
getRepository
public Repository getRepository()
-
setRepository
public void setRepository(Repository repository)
-
setName
public void setName(java.lang.String name)
Description copied from interface:DependencyResolver
Should only be used by configurator- Specified by:
setName
in interfaceDependencyResolver
- Overrides:
setName
in classAbstractResolver
- Parameters:
name
- the new name of the resolver
-
setSigner
public void setSigner(java.lang.String signerName)
-
findResourceUsingPattern
protected ResolvedResource findResourceUsingPattern(ModuleRevisionId mrid, java.lang.String pattern, Artifact artifact, ResourceMDParser rmdparser, java.util.Date date)
- Specified by:
findResourceUsingPattern
in classAbstractPatternsBasedResolver
-
getResource
protected Resource getResource(java.lang.String source) throws java.io.IOException
- Specified by:
getResource
in classBasicResolver
- Throws:
java.io.IOException
-
listResources
protected ResolvedResource[] listResources(Repository repository, ModuleRevisionId mrid, java.lang.String pattern, Artifact artifact)
List all revisions as resolved resources for the given artifact in the given repository using the given pattern, and using the given mrid except its revision.- Parameters:
repository
- the repository in which revisions should be locatedmrid
- the module revision id to look for (except revision)pattern
- the pattern to use to locate the revisionsartifact
- the artifact to find- Returns:
- an array of ResolvedResource, all pointing to a different revision of the given Artifact.
-
get
protected long get(Resource resource, java.io.File dest) throws java.io.IOException
- Specified by:
get
in classBasicResolver
- Throws:
java.io.IOException
-
publish
public void publish(Artifact artifact, java.io.File src, boolean overwrite) throws java.io.IOException
- Throws:
java.io.IOException
-
getDestination
protected java.lang.String getDestination(java.lang.String pattern, Artifact artifact, ModuleRevisionId mrid)
-
put
protected void put(Artifact artifact, java.io.File src, java.lang.String dest, boolean overwrite) throws java.io.IOException
- Throws:
java.io.IOException
-
putChecksum
protected void putChecksum(Artifact artifact, java.io.File src, java.lang.String dest, boolean overwrite, java.lang.String algorithm) throws java.io.IOException
- Throws:
java.io.IOException
-
putSignature
protected void putSignature(Artifact artifact, java.io.File src, java.lang.String dest, boolean overwrite) throws java.io.IOException
- Throws:
java.io.IOException
-
download
public DownloadReport download(Artifact[] artifacts, DownloadOptions options)
Description copied from interface:DependencyResolver
Download artifacts with specified DownloadOptions.The resolver will always make a best effort, and do not stop when an artifact is not available. It rather continue to attempt to download other requested artifacts, and report what has been done in the returned DownloadReport.
The returned DownloadReport is never
null
, and always contain anArtifactDownloadReport
for each requested Artifact.- Specified by:
download
in interfaceDependencyResolver
- Overrides:
download
in classBasicResolver
- Parameters:
artifacts
- an array of artifacts to download. Must not benull
.options
- options to apply for this download. Must not benull
.- Returns:
- a DownloadReport with details about each Artifact download.
-
findTokenValues
protected void findTokenValues(java.util.Collection<java.lang.String> names, java.util.List<java.lang.String> patterns, java.util.Map<java.lang.String,java.lang.String> tokenValues, java.lang.String token)
- Overrides:
findTokenValues
in classAbstractPatternsBasedResolver
-
listTokenValues
protected java.lang.String[] listTokenValues(java.lang.String pattern, java.lang.String token)
- Specified by:
listTokenValues
in classAbstractPatternsBasedResolver
-
exist
protected boolean exist(java.lang.String path)
- Specified by:
exist
in classAbstractPatternsBasedResolver
-
getTypeName
public java.lang.String getTypeName()
- Overrides:
getTypeName
in classAbstractResolver
-
dumpSettings
public void dumpSettings()
- Specified by:
dumpSettings
in interfaceDependencyResolver
- Overrides:
dumpSettings
in classAbstractPatternsBasedResolver
-
setSettings
public void setSettings(ResolverSettings settings)
- Specified by:
setSettings
in interfaceDependencyResolver
- Overrides:
setSettings
in classAbstractResolver
-
isAlwaysCheckExactRevision
public boolean isAlwaysCheckExactRevision()
-
setAlwaysCheckExactRevision
public void setAlwaysCheckExactRevision(boolean alwaysCheckExactRevision)
-
-