Class LibrarySearchPathManager

java.lang.Object
ghidra.app.util.importer.LibrarySearchPathManager

public class LibrarySearchPathManager extends Object
A simple class for managing the library search path and avoiding duplicate directories.
  • Constructor Details

    • LibrarySearchPathManager

      public LibrarySearchPathManager()
  • Method Details

    • getLibraryPaths

      public static String[] getLibraryPaths()
      Returns an array of directories to search for libraries
      Returns:
      an array of directories to search for libraries
    • getLibraryPathsList

      public static List<String> getLibraryPathsList()
      Returns an array of directories to search for libraries
      Returns:
      a list of directories to search for libraries
    • setLibraryPaths

      public static void setLibraryPaths(String[] paths)
      Sets the directories to search for libraries
      Parameters:
      paths - the new library search paths
    • restoreLibraryPaths

      public static void restoreLibraryPaths(String[] paths)
      Call this to restore paths that were previously persisted. If you really need to change the paths for the entire JVM, then call setLibraryPaths(String[]).
      Parameters:
      paths - the paths to restore
    • addPath

      public static boolean addPath(String path)
      Adds the specified path to the end of the path search list.
      Parameters:
      path - the path to add
      Returns:
      true if the path was appended, false if the path was a duplicate
    • addPathAt

      public static boolean addPathAt(int index, String path)
      Adds the path at the specified index in path search list.
      Parameters:
      index - The index
      path - the path to add
      Returns:
      true if the path was appended, false if the path was a duplicate
    • removePath

      public static boolean removePath(String path)
      Removes the path from the path search list.
      Parameters:
      path - the path the remove
      Returns:
      true if the path was removed, false if the path did not exist
    • reset

      public static void reset()
      Resets the library search path to match the system search paths.
    • clear

      public static void clear()
      Clears all paths.