class WorkspaceManager[ProjectType <: Project] extends AnyRef
WorkspaceManager: a component, which loads and maintains the list of projects made accessible via Ocular/Joern.
- Alphabetic
- By Inheritance
- WorkspaceManager
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new WorkspaceManager(path: String, loader: WorkspaceLoader[ProjectType] = DefaultLoader)
- path
path to to workspace.
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def closeProject(name: String): Option[Project]
Free up resources occupied by this project but do not remove project from disk.
- def cpg: Cpg
Obtain the cpg that was last loaded.
Obtain the cpg that was last loaded. Throws a runtime exception if no CPG has been loaded.
- def cpgExists(inputPath: String, isLegacy: Boolean = false): Boolean
Indicates whether a base CPG exists for @inputPath.
- def createProject(inputPath: String, projectName: String): Option[Path]
Create project for code stored at
inputPath
with the project namename
.Create project for code stored at
inputPath
with the project namename
. Ifname
is empty, the project name is derived frominputPath
. If a project for thisname
already exists, it is deleted from the workspace first. If no file or directory exists atinputPath
, then no project is created. Returns the path to the project directory as an optional String, and None if there was an error. - def deleteCurrentProject(): Unit
Remove currently active project from workspace and delete all associated workspace files from disk.
- def deleteProject(name: String): Option[Unit]
Remove project with name
name
from workspace and delete all associated workspace files from disk.Remove project with name
name
from workspace and delete all associated workspace files from disk.- name
the name of the project that should be removed
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def getActiveProject: Option[Project]
Retrieve the currently active project.
Retrieve the currently active project. If no project is active, None is returned.
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getNextOverlayDirName(baseCpg: Cpg, overlayName: String): String
- def getPath: String
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def loadedCpgs: List[Cpg]
A sorted list of all loaded CPGs
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def numberOfProjects: Int
Return the number of projects currently present in this workspace.
- def openProject(name: String, loader: (String) => Option[Cpg] = x =>
loadCpgRaw(x)): Option[Project]Open project by name and return it.
Open project by name and return it. If a project with this name does not exist, None is returned. If the CPG of this project is loaded, it is unloaded first and then reloaded. Returns project or None on error.
- name
of the project to load
- loader
function to perform CPG loading. This parameter only exists for testing purposes.
- def overlayDir(inputPath: String): String
Overlay directory for CPG with given @inputPath
- def overlayDirByProjectName(name: String): String
- def project(name: String): Option[Project]
- def projectByCpg(baseCpg: Cpg): Option[ProjectType]
Workspace record for the CPG, or none, if the CPG is not in the workspace
- def projectExists(inputPath: String): Boolean
Indicates whether a workspace record exists for @inputPath.
- def projectExistsForCpg(baseCpg: Cpg): Boolean
- def projects: List[Project]
- def reloadCpgByName(name: String, loadCpg: (String) => Option[Cpg]): Option[Cpg]
- def removeProject(name: String): Unit
Remove project named
name
from diskRemove project named
name
from disk- name
name of the project
- def reset(): Unit
Delete the workspace from disk, then initialize it again.
- def setActiveProject(name: String): Option[ProjectType]
Set active project to project with name
name
.Set active project to project with name
name
. If a project with this name does not exist, does nothing. - final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- WorkspaceManager → AnyRef → Any
- def unloadCpgByProjectName(name: String): Unit
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()