Package ghidra.feature.vt.api.util
Class VTSessionFileUtil
java.lang.Object
ghidra.feature.vt.api.util.VTSessionFileUtil
VTSessionFileUtil
provides methods for checking VTSessionDB
source and
destination program files prior to being opened and used during session instantiation.-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
canUpdate
(ghidra.framework.model.DomainFile file) Determine if the specifiedDomainFile
will permit update.static void
validateDestinationProgramFile
(ghidra.framework.model.DomainFile file, boolean includeFilePathInError, boolean silent) Validate a VT destination program to ensure it meets minimum criteria to open with a VTSession.static void
validateSourceProgramFile
(ghidra.framework.model.DomainFile file, boolean includeFilePathInError) Validate a VT source program to ensure it meets minimum criteria to open with a VTSession.
-
Method Details
-
validateSourceProgramFile
public static void validateSourceProgramFile(ghidra.framework.model.DomainFile file, boolean includeFilePathInError) throws IllegalArgumentException Validate a VT source program to ensure it meets minimum criteria to open with a VTSession. The following validation checks are performed:- file must correspond to a ProgramDB
- Parameters:
file
- VT Session source program domain fileincludeFilePathInError
- if true file path will be appended to any exception throw- Throws:
IllegalArgumentException
- if any VT source program file criteria is not satisfied
-
validateDestinationProgramFile
public static void validateDestinationProgramFile(ghidra.framework.model.DomainFile file, boolean includeFilePathInError, boolean silent) throws IllegalArgumentException Validate a VT destination program to ensure it meets minimum criteria to open with a VTSession. GUI mode only: If file is versioned and not checked-out the user may be prompted to perform an optional checkout of the file. Prompting for checkout will not occur if this method is invoked from the Swing thread or operating in a headless mode. The following validation checks are performed:- file must correspond to a ProgramDB
- file must be contained within the active project
- file must not be marked read-only
- if file is versioned it must be checked-out (user may be prompted to do this)
- Parameters:
file
- VT Session destination program domain fileincludeFilePathInError
- if true file path will be appended to any exception throwsilent
- if user interaction should not be performed. This should be true if filesystem lock is currently held.- Throws:
IllegalArgumentException
- if any VT destination program file criteria is not satisfied
-
canUpdate
public static boolean canUpdate(ghidra.framework.model.DomainFile file) Determine if the specifiedDomainFile
will permit update.- Parameters:
file
- domain file- Returns:
- true if file permits update else false
-