Class GetUrlContentTypeTask

java.lang.Object
ghidra.util.task.Task
ghidra.framework.protocol.ghidra.GetUrlContentTypeTask
All Implemented Interfaces:
MonitoredRunnable

public class GetUrlContentTypeTask extends Task
A blocking/modal Ghidra URL content type discovery task
  • Constructor Details

    • GetUrlContentTypeTask

      public GetUrlContentTypeTask(URL ghidraUrl)
      Construct a Ghidra URL content type discovery task
      Parameters:
      ghidraUrl - Ghidra URL (local or remote)
      Throws:
      IllegalArgumentException - if specified URL is not a Ghidra URL (see GhidraURL).
  • Method Details

    • getContentType

      public String getContentType()
      Get the discovered content type (e.g., "Program")
      Returns:
      content type or null if error occured or unsupported URL content
      Throws:
      IllegalStateException - if task has not completed execution
    • run

      public void run(TaskMonitor monitor)
      Description copied from class: Task
      This is the method that will be called to do the work

      Note: The run(TaskMonitor) method should not make any calls directly on Swing components, as these calls are not thread safe. Place Swing calls in a Runnable, then call Swing.runLater(Runnable) or Swing.runNow(Runnable)to schedule the Runnable inside of the AWT Event Thread.

      Specified by:
      run in class Task
      Parameters:
      monitor - The TaskMonitor that will monitor the executing Task