Class Workspace

  • All Implemented Interfaces:
    Constants, Registry, aQute.service.reporter.Report, aQute.service.reporter.Reporter, java.io.Closeable, java.lang.AutoCloseable, java.lang.Iterable<java.lang.String>

    public class Workspace
    extends Processor
    • Field Detail

      • BND_DEFAULT_WS

        public static final java.io.File BND_DEFAULT_WS
      • BND_CACHE_REPONAME

        public static final java.lang.String BND_CACHE_REPONAME
        See Also:
        Constant Field Values
      • CACHEDIR

        public static final java.lang.String CACHEDIR
      • STANDALONE_REPO_CLASS

        public static final java.lang.String STANDALONE_REPO_CLASS
        See Also:
        Constant Field Values
    • Constructor Detail

      • Workspace

        public Workspace​(java.io.File workspaceDir)
                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • Workspace

        public Workspace​(java.io.File workspaceDir,
                         java.lang.String bndDir)
                  throws java.lang.Exception
        Throws:
        java.lang.Exception
    • Method Detail

      • getProject

        public static Project getProject​(java.io.File projectDir)
                                  throws java.lang.Exception
        This static method finds the workspace and creates a project (or returns an existing project)
        Parameters:
        projectDir -
        Throws:
        java.lang.Exception
      • getDefaults

        public static Processor getDefaults()
      • createDefaultWorkspace

        public static Workspace createDefaultWorkspace()
                                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getWorkspace

        public static Workspace getWorkspace​(java.io.File workspaceDir)
                                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getWorkspaceWithoutException

        public static Workspace getWorkspaceWithoutException​(java.io.File workspaceDir)
                                                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • findWorkspace

        public static Workspace findWorkspace​(java.io.File base)
                                       throws java.lang.Exception
        /* Return the nearest workspace
        Throws:
        java.lang.Exception
      • getWorkspace

        public static Workspace getWorkspace​(java.io.File workspaceDir,
                                             java.lang.String bndDir)
                                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • setFileSystem

        public void setFileSystem​(java.io.File workspaceDir,
                                  java.lang.String bndDir)
                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getProjectFromFile

        public Project getProjectFromFile​(java.io.File projectDir)
                                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getProject

        public Project getProject​(java.lang.String bsn)
                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • isPresent

        public boolean isPresent​(java.lang.String name)
      • getCurrentProjects

        public java.util.Collection<Project> getCurrentProjects()
      • _workspace

        public java.lang.String _workspace​(java.lang.String[] args)
      • addCommand

        public void addCommand​(java.lang.String menu,
                               Action action)
      • removeCommand

        public void removeCommand​(java.lang.String menu)
      • fillActions

        public void fillActions​(java.util.Map<java.lang.String,​Action> all)
      • getAllProjects

        public java.util.Collection<Project> getAllProjects()
                                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • changedFile

        public void changedFile​(java.io.File f)
        Inform any listeners that we changed a file (created/deleted/changed).
        Parameters:
        f - The changed file
      • bracket

        public void bracket​(boolean begin)
      • signal

        public void signal​(aQute.service.reporter.Reporter reporter)
      • syncCache

        public void syncCache()
                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getRepositories

        public java.util.List<RepositoryPlugin> getRepositories()
                                                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getBuildOrder

        public java.util.Collection<Project> getBuildOrder()
                                                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getWorkspace

        public static Workspace getWorkspace​(java.lang.String path)
                                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getMaven

        public Maven getMaven()
      • setTypeSpecificPlugins

        protected void setTypeSpecificPlugins​(java.util.Set<java.lang.Object> list)
        Overrides:
        setTypeSpecificPlugins in class Processor
      • addExtensions

        protected void addExtensions​(java.util.Set<java.lang.Object> list)
        Add any extensions listed
        Overrides:
        addExtensions in class Processor
        Parameters:
        list -
      • isOffline

        public boolean isOffline()
      • getOffline

        public java.util.concurrent.atomic.AtomicBoolean getOffline()
      • setOffline

        public Workspace setOffline​(boolean on)
      • _global

        public java.lang.String _global​(java.lang.String[] args)
                                 throws java.lang.Exception
        Provide access to the global settings of this machine.
        Throws:
        java.lang.Exception
      • _user

        public java.lang.String _user​(java.lang.String[] args)
                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • _repodigests

        public java.lang.Object _repodigests​(java.lang.String[] args)
                                      throws java.lang.Exception
        Return the repository signature digests. These digests are a unique id for the contents of the repository
        Throws:
        java.lang.Exception
      • getRun

        public static Run getRun​(java.io.File file)
                          throws java.lang.Exception
        Throws:
        java.lang.Exception
      • report

        public void report​(java.util.Map<java.lang.String,​java.lang.Object> table)
                    throws java.lang.Exception
        Report details of this workspace
        Overrides:
        report in class Processor
        Throws:
        java.lang.Exception
      • getCache

        public java.io.File getCache​(java.lang.String name)
      • getWorkspaceRepository

        public WorkspaceRepository getWorkspaceRepository()
        Return the workspace repo
      • checkStructure

        public void checkStructure()
      • getBuildDir

        public java.io.File getBuildDir()
      • setBuildDir

        public void setBuildDir​(java.io.File buildDir)
      • isValid

        public boolean isValid()
      • getRepository

        public RepositoryPlugin getRepository​(java.lang.String repo)
                                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class Processor
      • getDriver

        public java.lang.String getDriver()
        Get the bnddriver, can be null if not set. The overallDriver is the environment that runs this bnd.
      • setDriver

        public static void setDriver​(java.lang.String driver)
        Set the driver of this environment
      • _driver

        public java.lang.String _driver​(java.lang.String[] args)
        Macro to return the driver. Without any arguments, we return the name of the driver. If there are arguments, we check each of the arguments against the name of the driver. If it matches, we return the driver name. If none of the args match the driver name we return an empty string (which is false).
      • addGestalt

        public static void addGestalt​(java.lang.String part,
                                      Attrs attrs)
        Add a gestalt to all workspaces. The gestalt is a set of parts describing the environment. Each part has a name and optionally attributes. This method adds a gestalt to the VM. Per workspace it is possible to augment this.
      • getGestalt

        public Attrs getGestalt​(java.lang.String part)
        Get the attrs for a gestalt part
      • getGestalt

        public Parameters getGestalt()
        Get the attrs for a gestalt part
      • getLayout

        public WorkspaceLayout getLayout()
        Get the layout style of the workspace.
      • _gestalt

        public java.lang.String _gestalt​(java.lang.String[] args)
        The macro to access the gestalt

        $ gestalt;part[;key[;value]]

      • toString

        public java.lang.String toString()
        Description copied from class: Processor
        Printout of the status of this processor for toString()
        Overrides:
        toString in class Processor
      • createProject

        public Project createProject​(java.lang.String name)
                              throws java.lang.Exception
        Create a project in this workspace
        Throws:
        java.lang.Exception
      • createWorkspace

        public static Workspace createWorkspace​(java.io.File wsdir)
                                         throws java.lang.Exception
        Create a new Workspace
        Parameters:
        wsdir -
        Throws:
        java.lang.Exception
      • addPlugin

        public boolean addPlugin​(java.lang.Class<?> plugin,
                                 java.lang.String alias,
                                 java.util.Map<java.lang.String,​java.lang.String> parameters,
                                 boolean force)
                          throws java.lang.Exception
        Add a plugin
        Parameters:
        plugin -
        Throws:
        java.lang.Exception
      • removePlugin

        public boolean removePlugin​(java.lang.String alias)
      • createStandaloneWorkspace

        public static Workspace createStandaloneWorkspace​(Processor run,
                                                          java.net.URI base)
                                                   throws java.lang.Exception
        Create a workspace that does not inherit from a cnf directory etc.
        Parameters:
        run -
        Throws:
        java.lang.Exception
      • isDefaultWorkspace

        public boolean isDefaultWorkspace()