Package ghidra.app.util.importer

# 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 Summary

  Constructors
  Constructor
  Description
  `LibrarySearchPathManager()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static boolean`
  `addPath(String path)`
  Adds the specified path to the end of the path search list.
  `static boolean`
  `addPathAt(int index, String path)`
  Adds the path at the specified index in path search list.
  `static void`
  `clear()`
  Clears all paths.
  `static String[]`
  `getLibraryPaths()`
  Returns an array of directories to search for libraries
  `static List<String>`
  `getLibraryPathsList()`
  Returns an array of directories to search for libraries
  `static boolean`
  `removePath(String path)`
  Removes the path from the path search list.
  `static void`
  `reset()`
  Resets the library search path to match the system search paths.
  `static void`
  `restoreLibraryPaths(String[] paths)`
  Call this to restore paths that were previously persisted.
  `static void`
  `setLibraryPaths(String[] paths)`
  Sets the directories to search for libraries

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 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.