Class WorkspaceRepository

java.lang.Object
aQute.bnd.build.WorkspaceRepository
All Implemented Interfaces:
Actionable, RepositoryPlugin

public class WorkspaceRepository extends Object implements RepositoryPlugin, Actionable
  • Field Details

    • workspace

      private final Workspace workspace
    • EXACT_VERSION_MATCH

      private static final Pattern EXACT_VERSION_MATCH
  • Constructor Details

    • WorkspaceRepository

      public WorkspaceRepository(Workspace workspace)
  • Method Details

    • get

      private File[] get(String bsn, String range) throws Exception
      Throws:
      Exception
    • get

      private File get(String bsn, String range, Strategy strategy, Map<String,String> properties) throws Exception
      Throws:
      Exception
    • matchVersion

      private boolean matchVersion(String range, Version version, boolean exact)
    • 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
    • put

      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 interface RepositoryPlugin
      Parameters:
      stream - The input stream with the artifact
      options - The put options. See RepositoryPlugin.PutOptions, can be null, which will then take the default options like new PutOptions().
      Returns:
      The result of the put, never null. See RepositoryPlugin.PutResult
      Throws:
      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, or when another error has occurred.
    • list

      public List<String> list(String pattern) throws Exception
      Description copied from interface: RepositoryPlugin
      Return a list of bsns that are present in the repository.
      Specified by:
      list in interface RepositoryPlugin
      Parameters:
      pattern - A <ahref="https://en.wikipedia.org/wiki/Glob_%28programming%29"> glob 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:
      Exception
    • versions

      public SortedSet<Version> versions(String bsn) throws Exception
      Description copied from interface: RepositoryPlugin
      Return a list of versions.
      Specified by:
      versions in interface RepositoryPlugin
      Throws:
      Exception
    • getName

      public String getName()
      Specified by:
      getName in interface RepositoryPlugin
      Returns:
      The name of the repository
    • getLocation

      public String getLocation()
      Description copied from interface: RepositoryPlugin
      Return a location identifier of this repository
      Specified by:
      getLocation in interface RepositoryPlugin
    • get

      public File get(String bsn, Version version, Map<String,String> properties, RepositoryPlugin.DownloadListener... listeners) throws 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 interface RepositoryPlugin
      Parameters:
      bsn - Bundle-SymbolicName of the searched bundle
      version - Version requested
      listeners - Zero or more download listener that will be notified of the outcome.
      Returns:
      A file to the revision or null if not found
      Throws:
      Exception - when anything goes wrong, in this case no listeners will be called back.
    • actions

      public Map<String,Runnable> actions(Object... target) throws Exception
      Description copied from interface: Actionable
      Return a map with command names (potentially localized) and a Runnable. The caller can execute the caller at will.
      Specified by:
      actions in interface Actionable
      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:
      Exception
    • tooltip

      public String tooltip(Object... target) throws Exception
      Description copied from interface: Actionable
      Return a tooltip for the given target or the encompassing entity if null is passed.
      Specified by:
      tooltip in interface Actionable
      Parameters:
      target - the target, any number of parameters to identify
      Returns:
      the tooltip or null
      Throws:
      Exception
    • title

      public String title(Object... target) throws Exception
      Description copied from interface: Actionable
      Provide a title for an element.
      Specified by:
      title in interface Actionable
      Parameters:
      target - the target, any number of parameters to identify
      Returns:
      the text for this element
      Throws:
      Exception
    • getIcon

      public String getIcon()
      Description copied from interface: RepositoryPlugin
      Return a name of an icon
      Specified by:
      getIcon in interface RepositoryPlugin
    • isRemote

      public boolean isRemote()
      Description copied from interface: RepositoryPlugin
      Indicate if this repo is remote or local
      Specified by:
      isRemote in interface RepositoryPlugin
      Returns:
      true if this is a remote repo