Package aQute.bnd.build
Class WorkspaceRepository
- java.lang.Object
-
- aQute.bnd.build.WorkspaceRepository
-
- All Implemented Interfaces:
Actionable,RepositoryPlugin
public class WorkspaceRepository extends java.lang.Object implements RepositoryPlugin, Actionable
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface aQute.bnd.service.RepositoryPlugin
RepositoryPlugin.DownloadListener, RepositoryPlugin.PutOptions, RepositoryPlugin.PutResult
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.regex.PatternEXACT_VERSION_MATCHprivate Workspaceworkspace-
Fields inherited from interface aQute.bnd.service.RepositoryPlugin
DEFAULTOPTIONS
-
-
Constructor Summary
Constructors Constructor Description WorkspaceRepository(Workspace workspace)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.Runnable>actions(java.lang.Object... target)Return a map with command names (potentially localized) and a Runnable.booleancanWrite()Answer if this repository can be used to store files.java.io.Fileget(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.private java.io.File[]get(java.lang.String bsn, java.lang.String range)private java.io.Fileget(java.lang.String bsn, java.lang.String range, Strategy strategy, java.util.Map<java.lang.String,java.lang.String> properties)java.lang.StringgetIcon()Return a name of an iconjava.lang.StringgetLocation()Return a location identifier of this repositoryjava.lang.StringgetName()booleanisRemote()Indicate if this repo is remote or localjava.util.List<java.lang.String>list(java.lang.String pattern)Return a list of bsns that are present in the repository.private booleanmatchVersion(java.lang.String range, Version version, boolean exact)RepositoryPlugin.PutResultput(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.java.lang.Stringtitle(java.lang.Object... target)Provide a title for an element.java.lang.Stringtooltip(java.lang.Object... target)Return a tooltip for the given target or the encompassing entity if null is passed.java.util.SortedSet<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, toString, wait, wait, wait
-
Methods inherited from interface aQute.bnd.service.RepositoryPlugin
getStatus, isOk
-
-
-
-
Field Detail
-
workspace
private final Workspace workspace
-
EXACT_VERSION_MATCH
private static final java.util.regex.Pattern EXACT_VERSION_MATCH
-
-
Constructor Detail
-
WorkspaceRepository
public WorkspaceRepository(Workspace workspace)
-
-
Method Detail
-
get
private java.io.File[] get(java.lang.String bsn, java.lang.String range) throws java.lang.Exception- Throws:
java.lang.Exception
-
get
private java.io.File get(java.lang.String bsn, java.lang.String range, Strategy strategy, java.util.Map<java.lang.String,java.lang.String> properties) throws java.lang.Exception- Throws:
java.lang.Exception
-
matchVersion
private boolean matchVersion(java.lang.String range, Version version, boolean exact)
-
canWrite
public boolean canWrite()
Description copied from interface:RepositoryPluginAnswer if this repository can be used to store files.- Specified by:
canWritein 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:RepositoryPluginPut 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:
putin 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 pattern) throws java.lang.ExceptionDescription copied from interface:RepositoryPluginReturn a list of bsns that are present in the repository.- Specified by:
listin interfaceRepositoryPlugin- Parameters:
pattern- 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:RepositoryPluginReturn a list of versions.- Specified by:
versionsin interfaceRepositoryPlugin- Throws:
java.lang.Exception
-
getName
public java.lang.String getName()
- Specified by:
getNamein interfaceRepositoryPlugin- Returns:
- The name of the repository
-
getLocation
public java.lang.String getLocation()
Description copied from interface:RepositoryPluginReturn a location identifier of this repository- Specified by:
getLocationin 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.ExceptionDescription copied from interface:RepositoryPluginReturn 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:
getin 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.
-
actions
public java.util.Map<java.lang.String,java.lang.Runnable> actions(java.lang.Object... target) throws java.lang.ExceptionDescription copied from interface:ActionableReturn a map with command names (potentially localized) and a Runnable. The caller can execute the caller at will.- Specified by:
actionsin interfaceActionable- Parameters:
target- the target object, null if commands for the encompassing entity is sought (e.g. the repo itself).- Returns:
- A Map with the actions or null if no actions are available.
- Throws:
java.lang.Exception
-
tooltip
public java.lang.String tooltip(java.lang.Object... target) throws java.lang.ExceptionDescription copied from interface:ActionableReturn a tooltip for the given target or the encompassing entity if null is passed.- Specified by:
tooltipin interfaceActionable- Parameters:
target- the target, any number of parameters to identify- Returns:
- the tooltip or null
- Throws:
java.lang.Exception
-
title
public java.lang.String title(java.lang.Object... target) throws java.lang.ExceptionDescription copied from interface:ActionableProvide a title for an element.- Specified by:
titlein interfaceActionable- Parameters:
target- the target, any number of parameters to identify- Returns:
- the text for this element
- Throws:
java.lang.Exception
-
getIcon
public java.lang.String getIcon()
Description copied from interface:RepositoryPluginReturn a name of an icon- Specified by:
getIconin interfaceRepositoryPlugin
-
isRemote
public boolean isRemote()
Description copied from interface:RepositoryPluginIndicate if this repo is remote or local- Specified by:
isRemotein interfaceRepositoryPlugin- Returns:
- true if this is a remote repo
-
-