Package generic.util
Class Path
- java.lang.Object
-
- generic.util.Path
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringGHIDRA_HOMEstatic java.lang.StringUSER_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 intcompareTo(Path p)booleanequals(java.lang.Object obj)booleanexists()ResourceFilegetPath()java.lang.StringgetPathAsString()Returns the path as a string with path element placeholders, such asGHIDRA_HOME.inthashCode()booleanisEditable()Returns true if this path can be modified.booleanisEnabled()Returns true if this path is enabled.booleanisInstallationFile()Returns true if the given path is a file inside of the current Ghidra application.booleanisReadOnly()Returns true if this path is read-only, which indicates the path cannot be written.voidsetEnabled(boolean isEnabled)voidsetPath(ResourceFile path)voidsetPath(java.lang.String path)java.lang.StringtoString()
-
-
-
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:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein 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:
toStringin classjava.lang.Object
-
-