Package ghidra.app.util.importer
Class LibrarySearchPathManager
- java.lang.Object
-
- ghidra.app.util.importer.LibrarySearchPathManager
-
public class LibrarySearchPathManager extends java.lang.ObjectA simple class for managing the library search path and avoiding duplicate directories.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCURRENT_DIRECTORY
-
Constructor Summary
Constructors Constructor Description LibrarySearchPathManager()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanaddPath(java.lang.String path)Adds the specified path to the end of the path search list.static booleanaddPathAt(int index, java.lang.String path)Adds the path at the specified index in path search list.static voidclear()Clears all paths.static java.lang.String[]getLibraryPaths()Returns an array of directories to search for librariesstatic java.util.List<java.lang.String>getLibraryPathsList()Returns an array of directories to search for librariesstatic booleanremovePath(java.lang.String path)Removes the path from the path search list.static voidreset()Resets the library search path to match the system search paths.static voidrestoreLibraryPaths(java.lang.String[] paths)Call this to restore paths that were previously persisted.static voidsetLibraryPaths(java.lang.String[] paths)Sets the directories to search for libraries
-
-
-
Field Detail
-
CURRENT_DIRECTORY
public static final java.lang.String CURRENT_DIRECTORY
- See Also:
- Constant Field Values
-
-
Method Detail
-
getLibraryPaths
public static java.lang.String[] getLibraryPaths()
Returns an array of directories to search for libraries- Returns:
- an array of directories to search for libraries
-
getLibraryPathsList
public static java.util.List<java.lang.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(java.lang.String[] paths)
Sets the directories to search for libraries- Parameters:
paths- the new library search paths
-
restoreLibraryPaths
public static void restoreLibraryPaths(java.lang.String[] paths)
Call this to restore paths that were previously persisted. If you really need to change the paths for the entire JVM, then callsetLibraryPaths(String[]).- Parameters:
the- paths to restore
-
addPath
public static boolean addPath(java.lang.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, java.lang.String path)Adds the path at the specified index in path search list.- Parameters:
path- the path to add- Returns:
- true if the path was appended, false if the path was a duplicate
-
removePath
public static boolean removePath(java.lang.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.
-
-