Package ghidra.framework.model
Interface ProjectManager
- All Known Implementing Classes:
DefaultProjectManager
,TestProjectManager
public interface ProjectManager
Interface for methods to create, open, and delete projects; maintains a
list of known project views that the user opened.
It has a handle to the currently opened project. A project can be
opened by one user at a time.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateProject
(ProjectLocator projectLocator, RepositoryAdapter repAdapter, boolean remember) Create a project on the local filesystem.boolean
deleteProject
(ProjectLocator projectLocator) Delete the project in the given location.void
forgetViewedProject
(URL url) Remove the project url from the list of known viewed projects.Get the project that is currently open.Get the last opened (active) project.Get the information that was last used to access a repository managed by a Ghidra server.Get list of projects that user most recently opened.URL[]
Get list of projects that user most recently viewed.getRepositoryServerAdapter
(String host, int portNumber, boolean forceConnect) Establish a connection to the given host and port number.Return the user's ToolChestopenProject
(ProjectLocator projectLocator, boolean doRestore, boolean resetOwner) Open a project from the file system.boolean
projectExists
(ProjectLocator projectLocator) Returns true if a project with the given projectLocator exists.void
rememberProject
(ProjectLocator projectLocator) Keep the projectLocator on the list of known projects.void
rememberViewedProject
(URL url) Keep the url on the list of known projects.void
setLastOpenedProject
(ProjectLocator projectLocator) Set the projectLocator of last opened (active) project; this projectLocator is returned in the getLastOpenedProject() method.
-
Field Details
-
APPLICATION_TOOL_EXTENSION
- See Also:
-
APPLICATION_TOOLS_DIR_NAME
- See Also:
-
-
Method Details
-
createProject
Project createProject(ProjectLocator projectLocator, RepositoryAdapter repAdapter, boolean remember) throws IOException Create a project on the local filesystem.- Parameters:
projectLocator
- location for where the project should be createdrepAdapter
- repository adapter if this project is to be a shared project; may be null if the project is not shared.remember
- if false the new project should not be remembered (i.e., recently opened, etc.)- Returns:
- the new project
- Throws:
IOException
- if user cannot access/write the project location
-
getRecentProjects
ProjectLocator[] getRecentProjects()Get list of projects that user most recently opened.- Returns:
- list of project URLs
-
getRecentViewedProjects
URL[] getRecentViewedProjects()Get list of projects that user most recently viewed.- Returns:
- list of project URLs
-
getActiveProject
Project getActiveProject()Get the project that is currently open.- Returns:
- currently open project, return null if there is no project opened
-
getLastOpenedProject
ProjectLocator getLastOpenedProject()Get the last opened (active) project.- Returns:
- project last opened by the user; returns NULL if a project was never opened OR the last opened project is no longer valid
-
setLastOpenedProject
Set the projectLocator of last opened (active) project; this projectLocator is returned in the getLastOpenedProject() method.- Parameters:
projectLocator
- project location of last project that was opened
-
rememberProject
Keep the projectLocator on the list of known projects.- Parameters:
projectLocator
- project location
-
rememberViewedProject
Keep the url on the list of known projects.- Parameters:
url
- project identifier
-
forgetViewedProject
Remove the project url from the list of known viewed projects.- Parameters:
url
- project identifier
-
openProject
Project openProject(ProjectLocator projectLocator, boolean doRestore, boolean resetOwner) throws NotFoundException, NotOwnerException, LockException Open a project from the file system. Add the project url to the list of known projects.- Parameters:
projectLocator
- project locationdoRestore
- true if the project should be restoredresetOwner
- if true, the owner of the project will be changed to the current user.- Returns:
- opened project
- Throws:
NotFoundException
- if the file for the project was not found.NotOwnerException
- if the project owner is not the userLockException
- if the project is already opened by another user
-
deleteProject
Delete the project in the given location.- Parameters:
projectLocator
- project location- Returns:
- false if no project was deleted.
-
projectExists
Returns true if a project with the given projectLocator exists.- Parameters:
projectLocator
- project location
-
getRepositoryServerAdapter
RepositoryServerAdapter getRepositoryServerAdapter(String host, int portNumber, boolean forceConnect) Establish a connection to the given host and port number.- Parameters:
host
- server name or IP addressportNumber
- server port or 0 for defaultforceConnect
- if true and currently not connected, an attempt will be be to connect- Returns:
- a handle to the remote server containing shared repositories
-
getMostRecentServerInfo
ServerInfo getMostRecentServerInfo()Get the information that was last used to access a repository managed by a Ghidra server. -
getUserToolChest
ToolChest getUserToolChest()Return the user's ToolChest
-