Package ghidra.framework.model
Class ProjectDataUtils
java.lang.Object
ghidra.framework.model.ProjectDataUtils
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA not-thread-safeDomainFileiterator that recursively walks aproject's dataand returns eachDomainFilethat is found.static classA not-thread-safeDomainFolderiterator that recursively walks aproject's dataand returns eachDomainFolderthat is found. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DomainFoldercreateDomainFolderPath(DomainFolder currentFolder, String path) Returns a GhidraDomainFolderwith the matching path, creating any missing parent folders as needed.static Iterable<DomainFile> descendantFiles(DomainFolder folder) static Iterable<DomainFolder> descendantFolders(DomainFolder folder) static StringgetUniqueName(DomainFolder folder, String baseName) Returns a unique name in a GhidraDomainFolder.static DomainFolderlookupDomainPath(DomainFolder currentFolder, String path) Returns a GhidraDomainFolderwith the matching path, or null if not found.
-
Constructor Details
-
ProjectDataUtils
public ProjectDataUtils()
-
-
Method Details
-
descendantFiles
- Parameters:
folder-- Returns:
-
descendantFolders
- Parameters:
folder-- Returns:
-
createDomainFolderPath
public static DomainFolder createDomainFolderPath(DomainFolder currentFolder, String path) throws InvalidNameException, IOException Returns a GhidraDomainFolderwith the matching path, creating any missing parent folders as needed.- Parameters:
currentFolder- startingDomainFolder.path- relative path to the desired DomainFolder, using forward slashes as separators. Empty string ok, multiple slashes in a row treated as single slash, trailing slashes ignored.- Returns:
DomainFolderthat the path points to.- Throws:
InvalidNameException- if bad nameIOException- if problem when creating folder
-
lookupDomainPath
Returns a GhidraDomainFolderwith the matching path, or null if not found.- Parameters:
currentFolder- startingDomainFolder.path- relative path to the desired DomainFolder, using forward slashes as separators. Empty string ok, multiple slashes in a row treated as single slash, trailing slashes ignored.- Returns:
DomainFolderthat the path points to or null if not found.
-
getUniqueName
Returns a unique name in a GhidraDomainFolder.- Parameters:
folder-DomainFolderto check for child name collisions.baseName- String base name of the file or folder- Returns:
- "baseName" if no collisions, or "baseNameNNN" (where NNN is an incrementing integer value) when collisions are found, or null if there are more than 1000 collisions.
-