public interface Project
An object representing an IntelliJ project.
To get all of its modules, use ModuleManager.getInstance(project).getModules().
To iterate over all project source files and directories,
use ProjectFileIndex.SERVICE.getInstance(project).iterateContent(iterator).
To get the list of all open projects, use ProjectManager.getInstance().getOpenProjects().
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescription@Nullable StringDeprecated.@NotNull StringReturns a workspace file:path/to/project/project.iws- for file-based projectspath/to/project/.idea/workspace.xml- for directory-based ones Returnsnullfor default project.@NotNull StringgetName()Returns a name ot the project.default @Nullable StringReturns presentable project path: getProjectFilePath() for file-based projects, getBasePath() for directory-based ones.
* Returnsnullfor default project.@Nullable StringbooleanbooleanbooleanisOpen()voidsave()
-
Field Details
-
DIRECTORY_STORE_FOLDER
- See Also:
-
-
Method Details
-
getName
Returns a name ot the project. For a directory-based project it's an arbitrary string specified by user at project creation or later in a project settings. For a file-based project it's a name of a project file without extension.- Returns:
- project name
-
getBasePath
Deprecated.Returns a path to a project base directory (see #getBaseDir()).
Returnsnullfor default project.- See Also:
-
com.intellij.openapi.project.ProjectUtil#guessProjectDir
-
getProjectFilePath
- Returns:
- a path to project file (see #getProjectFile()) or
nullfor default project.
-
getPresentableUrl
Returns presentable project path: getProjectFilePath() for file-based projects, getBasePath() for directory-based ones.
* Returnsnullfor default project. Note: the word "presentable" here implies file system presentation, not a UI one.- Returns:
- presentable project path
-
getLocationHash
Returns a workspace file:
path/to/project/project.iws- for file-based projectspath/to/project/.idea/workspace.xml- for directory-based ones
nullfor default project.- Returns:
- workspace file, or null for default project
-
save
void save() -
isOpen
boolean isOpen() -
isInitialized
boolean isInitialized() -
isDefault
boolean isDefault()
-