public class FileRepo extends Object implements Plugin, RepositoryPlugin, Refreshable, RegistryPlugin
RepositoryPlugin.Strategy
Modifier and Type | Field and Description |
---|---|
static String |
LOCATION |
static String |
NAME |
static String |
READONLY |
protected File |
root |
Constructor and Description |
---|
FileRepo() |
FileRepo(String name,
File location,
boolean canWrite) |
Modifier and Type | Method and Description |
---|---|
boolean |
canWrite()
Answer if this repository can be used to store files.
|
protected void |
fireBundleAdded(Jar jar,
File file) |
File[] |
get(String bsn,
String versionRange)
Get a list of URLs to bundles that are constrained by the bsn and
versionRange.
|
File |
get(String bsn,
String version,
RepositoryPlugin.Strategy strategy,
Map<String,String> properties)
Return a URL to a matching version of the given bundle.
|
String |
getName() |
File |
getRoot() |
protected void |
init() |
List<String> |
list(String regex)
Return a list of bsns that are present in the repository.
|
File |
put(Jar jar)
Put a JAR file in the repository.
|
boolean |
refresh() |
void |
setLocation(String string) |
void |
setProperties(Map<String,String> map)
Give the plugin the remaining properties.
|
void |
setRegistry(Registry registry) |
void |
setReporter(Reporter reporter)
Set the current reporter.
|
String |
toString() |
List<Version> |
versions(String bsn)
Return a list of versions.
|
public static String LOCATION
public static String READONLY
public static String NAME
protected File root
public void setProperties(Map<String,String> map)
Plugin
setProperties
in interface Plugin
map
- attributes and directives for this plugin's clausepublic File[] get(String bsn, String versionRange) throws Exception
get
in interface RepositoryPlugin
bsn
- Bundle-SymbolicName of the searched bundleversionRange
- Version range for this bundle,"latest" if you only want the
latest, or null when you want all.Exception
- when anything goes wrongpublic boolean canWrite()
RepositoryPlugin
canWrite
in interface RepositoryPlugin
public File put(Jar jar) throws Exception
RepositoryPlugin
put
in interface RepositoryPlugin
Exception
public void setLocation(String string)
public void setReporter(Reporter reporter)
Plugin
setReporter
in interface Plugin
public List<String> list(String regex) throws Exception
RepositoryPlugin
list
in interface RepositoryPlugin
regex
- if not null, match against the bsn and if matches, return
otherwise skipException
public List<Version> versions(String bsn) throws Exception
RepositoryPlugin
versions
in interface RepositoryPlugin
Exception
public File getRoot()
getRoot
in interface Refreshable
public boolean refresh()
refresh
in interface Refreshable
public String getName()
getName
in interface RepositoryPlugin
public File get(String bsn, String version, RepositoryPlugin.Strategy strategy, Map<String,String> properties) throws Exception
RepositoryPlugin
get
in interface RepositoryPlugin
bsn
- Bundle-SymbolicName of the searched bundleversion
- Version range for this bundle,"latest" if you only want the
latest, or null when you want all.strategy
- Get the highest or the lowestException
- when anything goes wrongpublic void setRegistry(Registry registry)
setRegistry
in interface RegistryPlugin
Copyright © 2015 aQute SARL. All rights reserved.