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 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.Path(java.io.File file)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 Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Path p)booleanequals(java.lang.Object obj)booleanexists()static ResourceFilefromPathString(java.lang.String path)Parse the path string with path element placeholders, such asGHIDRA_HOME.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 file)voidsetPath(java.lang.String path)static java.lang.StringtoPathString(ResourceFile file)Returns the path as a string with path element placeholders, such asGHIDRA_HOME.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 file)
Identifies an absolute directory path which has the following attributes:- isEnabled = true
 - isEditable = true
 - isReadOnly = false
 
- Parameters:
 file- absolute directory path
 
- 
Path
public Path(ResourceFile file)
Identifies an absolute directory path which has the following attributes:- isEnabled = true
 - isEditable = true
 - isReadOnly = false
 
- Parameters:
 file- absolute directory path
 
- 
Path
public Path(ResourceFile file, boolean isEnabled, boolean isEditable, boolean isReadOnly)
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
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()
 
- 
fromPathString
public static ResourceFile fromPathString(java.lang.String path)
Parse the path string with path element placeholders, such asGHIDRA_HOME.- Parameters:
 path- the path- Returns:
 - the path as a ResourceFile.
 
 
- 
toPathString
public static java.lang.String toPathString(ResourceFile file)
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
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 file)
 
- 
exists
public boolean exists()
 
- 
toString
public java.lang.String toString()
- Overrides:
 toStringin classjava.lang.Object
 
 - 
 
 -