aQute.bnd.maven
Class MavenRepository

java.lang.Object
  extended by aQute.bnd.maven.MavenRepository
All Implemented Interfaces:
BsnToMavenPath, Plugin, RepositoryPlugin

public class MavenRepository
extends java.lang.Object
implements RepositoryPlugin, Plugin, BsnToMavenPath


Nested Class Summary
 
Nested classes/interfaces inherited from interface aQute.bnd.service.RepositoryPlugin
RepositoryPlugin.Strategy
 
Field Summary
static java.lang.String NAME
           
 
Constructor Summary
MavenRepository()
           
 
Method Summary
 boolean canWrite()
          Answer if this repository can be used to store files.
 java.io.File[] get(java.lang.String bsn, java.lang.String version)
          Return a URL to a matching version of the given bundle.
 java.io.File get(java.lang.String bsn, java.lang.String range, RepositoryPlugin.Strategy strategy, java.util.Map<java.lang.String,java.lang.String> properties)
          Return a URL to a matching version of the given bundle.
 java.lang.String[] getGroupAndArtifact(java.lang.String bsn)
           
 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.
 java.io.File put(Jar jar)
          Put a JAR file in the repository.
 void setProperties(java.util.Map<java.lang.String,java.lang.String> map)
          Give the plugin the remaining properties.
 void setReporter(Reporter processor)
          Set the current reporter.
 void setRoot(java.io.File f)
           
 java.lang.String toString()
           
 java.util.List<Version> versions(java.lang.String bsn)
          Return a list of versions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NAME

public static java.lang.String NAME
Constructor Detail

MavenRepository

public MavenRepository()
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

canWrite

public boolean canWrite()
Description copied from interface: RepositoryPlugin
Answer if this repository can be used to store files.

Specified by:
canWrite in interface RepositoryPlugin
Returns:
true if writable

get

public java.io.File[] get(java.lang.String bsn,
                          java.lang.String version)
                   throws java.lang.Exception
Description copied from interface: RepositoryPlugin
Return a URL to a matching version of the given bundle.

Specified by:
get in interface RepositoryPlugin
Parameters:
bsn - Bundle-SymbolicName of the searched bundle
version - Version range for this bundle,"latest" if you only want the latest, or null when you want all.
Returns:
A list of URLs sorted on version, lowest version is at index 0. null is returned when no files with the given bsn ould be found.
Throws:
java.lang.Exception - when anything goes wrong

list

public java.util.List<java.lang.String> list(java.lang.String regex)
Description copied from interface: RepositoryPlugin
Return a list of bsns that are present in the repository.

Specified by:
list in interface RepositoryPlugin
Parameters:
regex - if not null, match against the bsn and if matches, return otherwise skip
Returns:
A list of bsns that match the regex parameter or all if regex is null

put

public java.io.File put(Jar jar)
                 throws java.lang.Exception
Description copied from interface: RepositoryPlugin
Put a JAR file in the repository.

Specified by:
put in interface RepositoryPlugin
Throws:
java.lang.Exception

versions

public java.util.List<Version> versions(java.lang.String bsn)
                                 throws java.lang.Exception
Description copied from interface: RepositoryPlugin
Return a list of versions.

Specified by:
versions in interface RepositoryPlugin
Throws:
java.lang.Exception

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 interface Plugin
Parameters:
map - attributes and directives for this plugin's clause

setReporter

public void setReporter(Reporter processor)
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 interface Plugin

getGroupAndArtifact

public java.lang.String[] getGroupAndArtifact(java.lang.String bsn)
Specified by:
getGroupAndArtifact in interface BsnToMavenPath

getName

public java.lang.String getName()
Specified by:
getName in interface RepositoryPlugin
Returns:
The name of the repository

get

public java.io.File get(java.lang.String bsn,
                        java.lang.String range,
                        RepositoryPlugin.Strategy strategy,
                        java.util.Map<java.lang.String,java.lang.String> properties)
                 throws java.lang.Exception
Description copied from interface: RepositoryPlugin
Return a URL to a matching version of the given bundle.

Specified by:
get in interface RepositoryPlugin
Parameters:
bsn - Bundle-SymbolicName of the searched bundle
range - Version range for this bundle,"latest" if you only want the latest, or null when you want all.
strategy - Get the highest or the lowest
Returns:
A list of URLs sorted on version, lowest version is at index 0. null is returned when no files with the given bsn ould be found.
Throws:
java.lang.Exception - when anything goes wrong

setRoot

public void setRoot(java.io.File f)