Package aQute.bnd.maven.support
Class MavenRemoteRepository
- java.lang.Object
-
- aQute.bnd.maven.support.MavenRemoteRepository
-
- All Implemented Interfaces:
Plugin
,RegistryPlugin
,RepositoryPlugin
public class MavenRemoteRepository extends java.lang.Object implements RepositoryPlugin, RegistryPlugin, Plugin
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface aQute.bnd.service.RepositoryPlugin
RepositoryPlugin.DownloadListener, RepositoryPlugin.PutOptions, RepositoryPlugin.PutResult
-
-
Field Summary
-
Fields inherited from interface aQute.bnd.service.RepositoryPlugin
DEFAULTOPTIONS
-
-
Constructor Summary
Constructors Constructor Description MavenRemoteRepository()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canWrite()
Answer if this repository can be used to store files.java.io.File
get(java.lang.String bsn, Version version, java.util.Map<java.lang.String,java.lang.String> properties, RepositoryPlugin.DownloadListener... listeners)
Return a URL to a matching version of the given bundle.java.io.File
get(java.lang.String bsn, java.lang.String version, Strategy strategy, java.util.Map<java.lang.String,java.lang.String> properties)
java.lang.String
getLocation()
Return a location identifier of this repositoryMaven
getMaven()
java.lang.String
getName()
java.util.List<java.lang.String>
list(java.lang.String regex)
Return a list of bsns that are present in the repository.RepositoryPlugin.PutResult
put(java.io.InputStream stream, RepositoryPlugin.PutOptions options)
Put an artifact (from the InputStream) into the repository.
There is no guarantee that the artifact on the input stream has not been modified after it's been put in the repository since that is dependent on the implementation of the repository.void
setMaven(Maven maven)
void
setProperties(java.util.Map<java.lang.String,java.lang.String> map)
Give the plugin the remaining properties.void
setRegistry(Registry registry)
void
setReporter(aQute.service.reporter.Reporter reporter)
Set the current reporter.void
setRepositories(java.net.URI... urls)
java.util.SortedSet<Version>
versions(java.lang.String bsn)
Return a list of versions.
-
-
-
Method Detail
-
get
public java.io.File get(java.lang.String bsn, java.lang.String version, Strategy strategy, java.util.Map<java.lang.String,java.lang.String> properties) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getMaven
public Maven getMaven()
-
canWrite
public boolean canWrite()
Description copied from interface:RepositoryPlugin
Answer if this repository can be used to store files.- Specified by:
canWrite
in interfaceRepositoryPlugin
- Returns:
- true if writable
-
put
public RepositoryPlugin.PutResult put(java.io.InputStream stream, RepositoryPlugin.PutOptions options) throws java.lang.Exception
Description copied from interface:RepositoryPlugin
Put an artifact (from the InputStream) into the repository.
There is no guarantee that the artifact on the input stream has not been modified after it's been put in the repository since that is dependent on the implementation of the repository.- Specified by:
put
in interfaceRepositoryPlugin
- Parameters:
stream
- The input stream with the artifactoptions
- The put options. SeeRepositoryPlugin.PutOptions
, can benull
, which will then take the default options like new PutOptions().- Returns:
- The result of the put, never null. See
RepositoryPlugin.PutResult
- Throws:
java.lang.Exception
- When the repository root directory doesn't exist, when the repository is read-only, when the specified checksum doesn't match the checksum of the fetched artifact (seeRepositoryPlugin.PutOptions.digest
), when the implementation wants to modify the artifact but isn't allowed, or when another error has occurred.
-
list
public java.util.List<java.lang.String> list(java.lang.String regex) throws java.lang.Exception
Description copied from interface:RepositoryPlugin
Return a list of bsns that are present in the repository.- Specified by:
list
in interfaceRepositoryPlugin
- Parameters:
regex
- Aglob pattern to be matched against bsns present in the repository, or null
.- Returns:
- A list of bsns that match the pattern parameter or all if pattern is null; repositories that do not support browsing or querying should return an empty list.
- Throws:
java.lang.Exception
-
versions
public java.util.SortedSet<Version> versions(java.lang.String bsn) throws java.lang.Exception
Description copied from interface:RepositoryPlugin
Return a list of versions.- Specified by:
versions
in interfaceRepositoryPlugin
- Throws:
java.lang.Exception
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfaceRepositoryPlugin
- Returns:
- The name of the repository
-
setRepositories
public void setRepositories(java.net.URI... urls)
-
setProperties
public void setProperties(java.util.Map<java.lang.String,java.lang.String> map)
Description copied from interface:Plugin
Give the plugin the remaining properties. When a plugin is declared, the clause can contain extra properties. All the properties and directives are given to the plugin to use.- Specified by:
setProperties
in interfacePlugin
- Parameters:
map
- attributes and directives for this plugin's clause
-
setReporter
public void setReporter(aQute.service.reporter.Reporter reporter)
Description copied from interface:Plugin
Set the current reporter. This is called at init time. This plugin should report all errors and warnings to this reporter.- Specified by:
setReporter
in interfacePlugin
-
setRegistry
public void setRegistry(Registry registry)
- Specified by:
setRegistry
in interfaceRegistryPlugin
-
setMaven
public void setMaven(Maven maven)
-
getLocation
public java.lang.String getLocation()
Description copied from interface:RepositoryPlugin
Return a location identifier of this repository- Specified by:
getLocation
in interfaceRepositoryPlugin
-
get
public java.io.File get(java.lang.String bsn, Version version, java.util.Map<java.lang.String,java.lang.String> properties, RepositoryPlugin.DownloadListener... listeners) throws java.lang.Exception
Description copied from interface:RepositoryPlugin
Return a URL to a matching version of the given bundle. If download listeners are specified then the returned file is not guaranteed to exist before a download listener is notified of success or failure. The callback can happen before the method has returned. If the returned file is null then download listeners are not called back. The intention of the Download Listeners is to allow a caller to obtain references to files that do not yet exist but are to be downloaded. If the downloads were done synchronously in the call, then no overlap of downloads could take place.- Specified by:
get
in interfaceRepositoryPlugin
- Parameters:
bsn
- Bundle-SymbolicName of the searched bundleversion
- Version requestedlisteners
- Zero or more download listener that will be notified of the outcome.- Returns:
- A file to the revision or null if not found
- Throws:
java.lang.Exception
- when anything goes wrong, in this case no listeners will be called back.
-
-