Session

public class Session

Constructors

Session

public Session(APIClient client)

Session

protected Session(APIClient client, long objectId)

Internal constructor

Methods

addListener

public void addListener(io.cocotec.coco.platform.coco.ide.SessionListener listener)

Adds a listener that will receive callbacks about events in this Session. The caller is responsible for ensuring that the SessionListener remains valid whilst the session is active: the session does not take ownership of the SessionListener at all.

addPackageSource

public void addPackageSource(String directory)

Adds a directory from which packages can be loaded. If this contains a Coco.toml file, then this will be treated as a package that packages can import. Otherwise this will be treated as a simple package that can’t be imported.

closeProject

public void closeProject(io.cocotec.coco.platform.coco.ide.Project project)

Closes a project, releasing all resources associated with this process. Unlike remove_project, this allows the project to still be used as a dependency of other projects. After this the project object must not be accessed anymore.

finalize

protected void finalize()

getObjectId

public long getObjectId()

Internal method

getOrCreate

public static Session getOrCreate(APIClient client, long objectId)

Internal method

openProject

public io.cocotec.coco.platform.coco.ide.Project openProject(String directory)

Opens a directory as a project. Thist must have previously been added as a package source.

removePackageSource

public void removePackageSource(String directory)

Removes a directory as a potential package source.