Class VTSessionFileUtil

java.lang.Object
ghidra.feature.vt.api.util.VTSessionFileUtil

public class VTSessionFileUtil extends Object
VTSessionFileUtil provides methods for checking VTSessionDB source and destination program files prior to being opened and used during session instantiation.
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    canUpdate(ghidra.framework.model.DomainFile file)
    Determine if the specified DomainFile 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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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
      If an error is thrown it is intended to be augmented for proper presentation.
      Parameters:
      file - VT Session source program domain file
      includeFilePathInError - 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)
      If an error is thrown it is intended to be augmented for proper presentation.
      Parameters:
      file - VT Session destination program domain file
      includeFilePathInError - if true file path will be appended to any exception throw
      silent - 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 specified DomainFile will permit update.
      Parameters:
      file - domain file
      Returns:
      true if file permits update else false