Package generic.util

Class Path

  • All Implemented Interfaces:
    java.lang.Comparable<Path>

    public class Path
    extends java.lang.Object
    implements java.lang.Comparable<Path>
    A class to represent a PATH item.
    • 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 = false
      Path​(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 = false
      Path​(java.lang.String path)
      Identifies an absolute directory path which has the following attributes: isEnabled = true isEditable = true isReadOnly = false
      Path​(java.lang.String path, boolean enabled)
      Identifies an absolute directory path which has the following attributes: isEditable = true isReadOnly = false
      Path​(java.lang.String path, boolean isEnabled, boolean isEditable, boolean isReadOnly)
      Identifies an absolute directory path with the specified attributes.
    • 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 path
        isEnabled - directory path will be searched if true
        isEditable - if true files contained within directory are considered editable
        isReadOnly - 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 path
        enabled - 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 path
        isEnabled - directory path will be searched if true
        isEditable - if true files contained within directory are considered editable
        isReadOnly - if true files contained within directory are considered read-only
    • Method Detail

      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.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)
      • getPathAsString

        public java.lang.String getPathAsString()
        Returns the path as a string with path element placeholders, such as GHIDRA_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)
      • exists

        public boolean exists()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • compareTo

        public int compareTo​(Path p)
        Specified by:
        compareTo in interface java.lang.Comparable<Path>