Package generic.util
Class Path
- java.lang.Object
-
- generic.util.Path
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
GHIDRA_HOME
static java.lang.String
USER_HOME
-
Constructor Summary
Constructors Constructor Description Path(ResourceFile path)
Identifies an absolute directory path which has the following attributes: isEnabled = true isEditable = true isReadOnly = falsePath(ResourceFile path, boolean isEnabled, boolean isEditable, boolean isReadOnly)
Identifies an absolute directory path with the specified attributes.Path(java.io.File path)
Identifies an absolute directory path which has the following attributes: isEnabled = true isEditable = true isReadOnly = falsePath(java.lang.String path)
Identifies an absolute directory path which has the following attributes: isEnabled = true isEditable = true isReadOnly = falsePath(java.lang.String path, boolean enabled)
Identifies an absolute directory path which has the following attributes: isEditable = true isReadOnly = falsePath(java.lang.String path, boolean isEnabled, boolean isEditable, boolean isReadOnly)
Identifies an absolute directory path with the specified attributes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Path p)
boolean
equals(java.lang.Object obj)
boolean
exists()
ResourceFile
getPath()
java.lang.String
getPathAsString()
Returns the path as a string with path element placeholders, such asGHIDRA_HOME
.int
hashCode()
boolean
isEditable()
Returns true if this path can be modified.boolean
isEnabled()
Returns true if this path is enabled.boolean
isInstallationFile()
Returns true if the given path is a file inside of the current Ghidra application.boolean
isReadOnly()
Returns true if this path is read-only, which indicates the path cannot be written.void
setEnabled(boolean isEnabled)
void
setPath(ResourceFile path)
void
setPath(java.lang.String path)
java.lang.String
toString()
-
-
-
Field Detail
-
GHIDRA_HOME
public static final java.lang.String GHIDRA_HOME
- See Also:
- Constant Field Values
-
USER_HOME
public static final java.lang.String USER_HOME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Path
public Path(java.io.File path)
Identifies an absolute directory path which has the following attributes:- isEnabled = true
- isEditable = true
- isReadOnly = false
- Parameters:
path
- absolute directory path
-
Path
public Path(ResourceFile path)
Identifies an absolute directory path which has the following attributes:- isEnabled = true
- isEditable = true
- isReadOnly = false
- Parameters:
path
- absolute directory path
-
Path
public Path(ResourceFile path, boolean isEnabled, boolean isEditable, boolean isReadOnly)
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
-
Path
public Path(java.lang.String path)
Identifies an absolute directory path which has the following attributes:- isEnabled = true
- isEditable = true
- isReadOnly = false
- Parameters:
path
- absolute directory path
-
Path
public Path(java.lang.String path, boolean enabled)
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
public Path(java.lang.String path, boolean isEnabled, boolean isEditable, boolean isReadOnly)
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 Detail
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
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
public ResourceFile getPath()
-
getPathAsString
public java.lang.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
public void setPath(java.lang.String path)
-
setPath
public void setPath(ResourceFile path)
-
exists
public boolean exists()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-