Package ghidra.framework.model
Class ProjectLocator
java.lang.Object
ghidra.framework.model.ProjectLocator
Lightweight descriptor of a local Project storage location.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionProjectLocator
(String path, String name) Construct a project locator object. -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
exists()
Returns true if project storage exists.Get the location of the project which will contain marker file (getMarkerFile()
) and project directory (getProjectDir()
).Returns the file that indicates a Ghidra project..getName()
Returns the name of the project identified by this project info..Returns the project directory.static String
Returns the project directory file extension..static String
Returns the file extension suitable for creating file filters for the file chooser.Returns project lock file to prevent multiple accesses to the same project at once..getURL()
Returns the URL associated with this local project. If using a temporary transient project location this URL should not be used..int
hashCode()
static boolean
isProjectDir
(File file) Returns whether the given file is a project directory..boolean
Returns true if this project URL corresponds to a transient project (e.g., corresponds to remote Ghidra URL).toString()
-
Field Details
-
PROJECT_FILE_SUFFIX
- See Also:
-
PROJECT_DIR_SUFFIX
- See Also:
-
DISALLOWED_CHARS
Set of characters specifically disallowed in project name or path. These characters may interfere with path and URL parsing.
-
-
Constructor Details
-
ProjectLocator
Construct a project locator object.- Parameters:
path
- absolute path to parent directory (may or may not exist). The user's temp directory will be used if this value is null or blank. The use of "\" characters will always be replaced with "/". WARNING: Use of a relative paths should be avoided (e.g., on a windows platform an absolute path should start with a drive letter specification such as C:\path). A path such as "/path" on windows will utilize the current default drive and will not throw an exception. If a drive letter is specified it must specify an absolute path (e.g., C:\, C:\path).name
- name of the project (may only contain alphanumeric characters or- Throws:
IllegalArgumentException
- if an absolute path is not specified or invalid project name
-
-
Method Details
-
isTransient
public boolean isTransient()Returns true if this project URL corresponds to a transient project (e.g., corresponds to remote Ghidra URL).- Returns:
- true if this project URL corresponds to a transient project (e.g., corresponds to remote Ghidra URL)
-
getURL
Returns the URL associated with this local project. If using a temporary transient project location this URL should not be used..- Returns:
- the URL associated with this local project. If using a temporary transient project location this URL should not be used.
-
getName
Returns the name of the project identified by this project info..- Returns:
- the name of the project identified by this project info.
-
getLocation
Get the location of the project which will contain marker file (getMarkerFile()
) and project directory (getProjectDir()
).Note: directory may or may not exist.
- Returns:
- project location directory
-
getProjectDir
Returns the project directory.- Returns:
- the project directory
-
getMarkerFile
Returns the file that indicates a Ghidra project..- Returns:
- the file that indicates a Ghidra project.
-
getProjectLockFile
Returns project lock file to prevent multiple accesses to the same project at once..- Returns:
- project lock file to prevent multiple accesses to the same project at once.
-
getProjectDirExtension
Returns the project directory file extension..- Returns:
- the project directory file extension.
-
equals
-
hashCode
public int hashCode() -
toString
-
getProjectExtension
Returns the file extension suitable for creating file filters for the file chooser.- Returns:
- the file extension suitable for creating file filters for the file chooser
-
isProjectDir
Returns whether the given file is a project directory..- Parameters:
file
- file to check- Returns:
- whether the given file is a project directory.
-
exists
public boolean exists()Returns true if project storage exists.- Returns:
- true if project storage exists
-