Class ProjectLocator

java.lang.Object
ghidra.framework.model.ProjectLocator

public class ProjectLocator extends Object
Lightweight descriptor of a local Project storage location.
  • Field Details

    • PROJECT_FILE_SUFFIX

      public static final String PROJECT_FILE_SUFFIX
      See Also:
    • PROJECT_DIR_SUFFIX

      public static final String PROJECT_DIR_SUFFIX
      See Also:
    • DISALLOWED_CHARS

      public static Set<Character> DISALLOWED_CHARS
      Set of characters specifically disallowed in project name or path. These characters may interfere with path and URL parsing.
  • Constructor Details

    • ProjectLocator

      public ProjectLocator(String path, String name)
      Construct a project locator object.
      Parameters:
      path - absolute path to parent directory (may or may not exist). The user's temp directory will be used if this value is null or blank. The use of "\" characters will always be replaced with "/". WARNING: Use of a relative paths should be avoided (e.g., on a windows platform an absolute path should start with a drive letter specification such as C:\path). A path such as "/path" on windows will utilize the current default drive and will not throw an exception. If a drive letter is specified it must specify an absolute path (e.g., C:\, C:\path).
      name - name of the project (may only contain alphanumeric characters or
      Throws:
      IllegalArgumentException - if an absolute path is not specified or invalid project name
  • Method Details

    • isTransient

      public boolean isTransient()
    • getURL

      public URL getURL()
    • getName

      public String getName()
    • getLocation

      public String getLocation()
      Get the location of the project which will contain marker file (getMarkerFile()) and project directory (getProjectDir()). Note: directory may or may not exist.
      Returns:
      project location directory
    • getProjectDir

      public File getProjectDir()
    • getMarkerFile

      public File getMarkerFile()
    • getProjectLockFile

      public File getProjectLockFile()
    • getProjectDirExtension

      public static String getProjectDirExtension()
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getProjectExtension

      public static String getProjectExtension()
    • isProjectDir

      public static boolean isProjectDir(File file)
      Returns whether the given file is a project directory.
      Parameters:
      file - file to check
      Returns:
      true if the file is a project directory
    • exists

      public boolean exists()