Package ghidra.framework.protocol.ghidra

# Class ContentTypeQueryTask

java.lang.Object
ghidra.util.task.Task
ghidra.framework.protocol.ghidra.GhidraURLQueryTask
ghidra.framework.protocol.ghidra.ContentTypeQueryTask

All Implemented Interfaces:
  `GhidraURLResultHandler`, `MonitoredRunnable`

public class ContentTypeQueryTask extends GhidraURLQueryTask
A blocking/modal Ghidra URL content type discovery task

- ## Field Summary

  ### Fields inherited from class ghidra.util.task.Task

  `taskMonitor, waitForTaskCompleted`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ContentTypeQueryTask(URL ghidraUrl)`
  Construct a Ghidra URL content type query task

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getContentType()`
  Get the discovered content type (e.g., "Program")
  `void`
  `processResult(DomainFile domainFile, URL url, TaskMonitor monitor)`
  Process the specified `domainFile` query result.

  ### Methods inherited from class ghidra.framework.protocol.ghidra.GhidraURLQueryTask

  `handleError, isDone, processResult, run`

  ### Methods inherited from class ghidra.util.task.Task

  `addTaskListener, canCancel, cancel, getStatusTextAlignment, getTaskTitle, getWaitForTaskCompleted, hasProgress, isCancelled, isModal, monitoredRun, notifyTaskListeners, setHasProgress`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface ghidra.framework.protocol.ghidra.GhidraURLResultHandler

  `externalLinkIgnored, handleUnauthorizedAccess`

- ## Constructor Details

  - ### ContentTypeQueryTask

    public ContentTypeQueryTask(URL ghidraUrl)
    Construct a Ghidra URL content type query 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

  - ### processResult

    public void processResult(DomainFile domainFile, URL url, TaskMonitor monitor)
    Description copied from interface: `GhidraURLResultHandler`
    Process the specified `domainFile` query result. Dissemination of the `domainFile` instance should be restricted and any use of it completed before the call to this method returns. Upon return from this method call the underlying connection will be closed and at which time the `domainFile` instance will become invalid.
    Specified by:
      `processResult` in interface `GhidraURLResultHandler`
    Overrides:
      `processResult` in class `GhidraURLQueryTask`
    Parameters:
      `domainFile` - `DomainFile` to which the URL refers.
      `url` - URL which was used to retrieve the specified `domainFile`
      `monitor` - task monitor