public class WorkspaceRepository extends Object implements RepositoryPlugin, Actionable
RepositoryPlugin.DownloadListener, RepositoryPlugin.PutOptions, RepositoryPlugin.PutResult
DEFAULTOPTIONS
Constructor and Description |
---|
WorkspaceRepository(Workspace workspace) |
Modifier and Type | Method and Description |
---|---|
Map<String,Runnable> |
actions(Object... target)
Return a map with command names (potentially localized) and a Runnable.
|
boolean |
canWrite()
Answer if this repository can be used to store files.
|
File |
get(String bsn,
Version version,
Map<String,String> properties,
RepositoryPlugin.DownloadListener... listeners)
Return a URL to a matching version of the given bundle.
|
String |
getLocation()
Return a location identifier of this repository
|
String |
getName() |
List<String> |
list(String pattern)
Return a list of bsns that are present in the repository.
|
RepositoryPlugin.PutResult |
put(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 (see RepositoryPlugin.PutOptions#allowArtifactChange ). |
String |
title(Object... target)
Provide a title for an element.
|
String |
tooltip(Object... target)
Return a tooltip for the given target or the encompassing entity if null
is passed.
|
SortedSet<Version> |
versions(String bsn)
Return a list of versions.
|
public WorkspaceRepository(Workspace workspace)
public boolean canWrite()
RepositoryPlugin
canWrite
in interface RepositoryPlugin
public RepositoryPlugin.PutResult put(InputStream stream, RepositoryPlugin.PutOptions options) throws Exception
RepositoryPlugin
RepositoryPlugin.PutOptions#allowArtifactChange
).put
in interface RepositoryPlugin
stream
- The input stream with the artifactoptions
- The put options. See RepositoryPlugin.PutOptions
, can
be null
, which will then take the default options like
new PutOptions().RepositoryPlugin.PutResult
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 (see
RepositoryPlugin.PutOptions.digest
), when the
implementation wants to modify the artifact but isn't allowed
(see RepositoryPlugin.PutOptions#allowArtifactChange
), or when another error has occurred.public List<String> list(String pattern) throws Exception
RepositoryPlugin
list
in interface RepositoryPlugin
pattern
- A null
.Exception
public SortedSet<Version> versions(String bsn) throws Exception
RepositoryPlugin
versions
in interface RepositoryPlugin
Exception
public String getName()
getName
in interface RepositoryPlugin
public String getLocation()
RepositoryPlugin
getLocation
in interface RepositoryPlugin
public File get(String bsn, Version version, Map<String,String> properties, RepositoryPlugin.DownloadListener... listeners) throws Exception
RepositoryPlugin
get
in interface RepositoryPlugin
bsn
- Bundle-SymbolicName of the searched bundleversion
- Version requestedlisteners
- Zero or more download listener that will be notified of the
outcome.Exception
- when anything goes wrong, in this case no listeners will be
called back.public Map<String,Runnable> actions(Object... target) throws Exception
Actionable
actions
in interface Actionable
target
- the target object, null if commands for the encompassing
entity is sought (e.g. the repo itself).Exception
public String tooltip(Object... target) throws Exception
Actionable
tooltip
in interface Actionable
target
- the target, any number of parameters to identifyException
public String title(Object... target) throws Exception
Actionable
title
in interface Actionable
target
- the target, any number of parameters to identifyException
Copyright © 2015 aQute SARL. All rights reserved.