Package generic.util
Class Path
java.lang.Object
generic.util.Path
- All Implemented Interfaces:
Comparable<Path>
A class to represent a PATH item.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionPath
(ResourceFile file) Identifies an absolute directory path which has the following attributes: isEnabled = true isEditable = true isReadOnly = falsePath
(ResourceFile file, boolean isEnabled, boolean isEditable, boolean isReadOnly) Identifies an absolute directory path with the specified attributes.Identifies an absolute directory path which has the following attributes: isEnabled = true isEditable = true isReadOnly = falseIdentifies an absolute directory path which has the following attributes: isEnabled = true isEditable = true isReadOnly = falseIdentifies an absolute directory path which has the following attributes: isEditable = true isReadOnly = falseIdentifies an absolute directory path with the specified attributes. -
Method Summary
Modifier and TypeMethodDescriptionint
boolean
boolean
exists()
static ResourceFile
fromPathString
(String path) Parse the path string with path element placeholders, such asGHIDRA_HOME
.getPath()
Returns the path as a string with path element placeholders, such asGHIDRA_HOME
.int
hashCode()
boolean
Returns true if this path can be modified.boolean
Returns true if this path is enabled.boolean
Returns true if the given path is a file inside of the current Ghidra application.boolean
Returns true if this path is read-only, which indicates the path cannot be written.void
setEnabled
(boolean isEnabled) void
setPath
(ResourceFile file) void
static String
toPathString
(ResourceFile file) Returns the path as a string with path element placeholders, such asGHIDRA_HOME
.toString()
-
Field Details
-
GHIDRA_HOME
- See Also:
-
USER_HOME
- See Also:
-
-
Constructor Details
-
Path
Identifies an absolute directory path which has the following attributes:- isEnabled = true
- isEditable = true
- isReadOnly = false
- Parameters:
file
- absolute directory path
-
Path
Identifies an absolute directory path which has the following attributes:- isEnabled = true
- isEditable = true
- isReadOnly = false
- Parameters:
file
- absolute directory path
-
Path
Identifies an absolute directory path with the specified attributes.- Parameters:
file
- absolute directory pathisEnabled
- directory path will be searched if trueisEditable
- if true files contained within directory are considered editableisReadOnly
- if true files contained within directory are considered read-only
-
Path
Identifies an absolute directory path which has the following attributes:- isEnabled = true
- isEditable = true
- isReadOnly = false
- Parameters:
path
- absolute directory path
-
Path
Identifies an absolute directory path which has the following attributes:- isEditable = true
- isReadOnly = false
- Parameters:
path
- absolute directory pathenabled
- directory path will be searched if true
-
Path
Identifies an absolute directory path with the specified attributes.- Parameters:
path
- absolute directory pathisEnabled
- directory path will be searched if trueisEditable
- if true files contained within directory are considered editableisReadOnly
- if true files contained within directory are considered read-only
-
-
Method Details
-
equals
-
hashCode
public int hashCode() -
isReadOnly
public boolean isReadOnly()Returns true if this path is read-only, which indicates the path cannot be written.- Returns:
- true if this path is read-only
-
isEditable
public boolean isEditable()Returns true if this path can be modified.- Returns:
- true if this path can be modified
-
isEnabled
public boolean isEnabled()Returns true if this path is enabled. Enablement indicates the path should be used.- Returns:
- true if this path is enabled
-
setEnabled
public void setEnabled(boolean isEnabled) -
getPath
-
fromPathString
Parse the path string with path element placeholders, such asGHIDRA_HOME
.- Parameters:
path
- the path- Returns:
- the path as a ResourceFile.
-
toPathString
Returns the path as a string with path element placeholders, such asGHIDRA_HOME
.- Parameters:
file
- the file to translate- Returns:
- the path as a string .
-
getPathAsString
Returns the path as a string with path element placeholders, such asGHIDRA_HOME
.- Returns:
- the path as a string .
-
isInstallationFile
public boolean isInstallationFile()Returns true if the given path is a file inside of the current Ghidra application.- Returns:
- true if the given path is a file inside of the current Ghidra application.
-
setPath
-
setPath
-
exists
public boolean exists() -
toString
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Path>
-