Class WorkspaceRepository

    • 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.
      boolean canWrite()
      Answer if this repository can be used to store files.
      java.io.File get​(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.
      java.lang.String getLocation()
      Return a location identifier of this repository
      java.lang.String getName()  
      java.util.List<java.lang.String> list​(java.lang.String pattern)
      Return a list of bsns that are present in the repository.
      RepositoryPlugin.PutResult put​(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.String title​(java.lang.Object... target)
      Provide a title for an element.
      java.lang.String tooltip​(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
    • Constructor Detail

      • WorkspaceRepository

        public WorkspaceRepository​(Workspace workspace)
    • Method Detail

      • 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

        public RepositoryPlugin.PutResult put​(java.io.InputStream stream,
                                              RepositoryPlugin.PutOptions options)
                                       throws java.lang.Exception
        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:
        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 (see RepositoryPlugin.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.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 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:
        java.lang.Exception
      • versions

        public java.util.SortedSet<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
      • 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,
                                Version version,
                                java.util.Map<java.lang.String,​java.lang.String> properties,
                                RepositoryPlugin.DownloadListener... listeners)
                         throws java.lang.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:
        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.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:
        java.lang.Exception
      • tooltip

        public java.lang.String tooltip​(java.lang.Object... target)
                                 throws java.lang.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:
        java.lang.Exception
      • title

        public java.lang.String title​(java.lang.Object... target)
                               throws java.lang.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:
        java.lang.Exception