Package ghidra.framework.protocol.ghidra

# Class GhidraURLResultHandlerAdapter

java.lang.Object
ghidra.framework.protocol.ghidra.GhidraURLResultHandlerAdapter

All Implemented Interfaces:
  `GhidraURLResultHandler`

public class GhidraURLResultHandlerAdapter extends Object implements GhidraURLResultHandler
`GhidraURLResultHandlerAdapter` provides a basic result handler for `GhidraURLQuery`. All uses of this adapter should override one or both of the processing methods `processResult(DomainFile, URL, TaskMonitor)` and `processResult(DomainFolder, URL, TaskMonitor)`. For any process method not overriden the default behavior is reporting Unsupported Content.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `GhidraURLResultHandlerAdapter()`
  Construct adapter.
  `GhidraURLResultHandlerAdapter(boolean throwErrorByDefault)`
  Construct adapter with preferred error handling.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `handleError(String title, String message, URL url, IOException cause)`
  Handle error which occurs during query operation.
  `void`
  `processResult(DomainFile domainFile, URL url, TaskMonitor monitor)`
  Process the specified `domainFile` query result.
  `void`
  `processResult(DomainFolder domainFolder, URL url, TaskMonitor monitor)`
  Process the specified `domainFolder` query result.

  ### 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

  - ### GhidraURLResultHandlerAdapter

    public GhidraURLResultHandlerAdapter()
    Construct adapter. If `handleError(String, String, URL, IOException)` is not overriden all errors are reported via `Msg.showError(Object, java.awt.Component, String, Object)`.

  - ### GhidraURLResultHandlerAdapter

    public GhidraURLResultHandlerAdapter(boolean throwErrorByDefault)
    Construct adapter with preferred error handling. There is no need to use this constructor if `handleError(String, String, URL, IOException)` is override.
    Parameters:
      `throwErrorByDefault` - if true all errors will be thrown as an `IOException`, otherwise error is reported via `Msg.showError(Object, java.awt.Component, String, Object)`.

- ## Method Details

  - ### processResult

    public void processResult(DomainFile domainFile, URL url, TaskMonitor monitor) throws IOException, CancelledException
    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`
    Parameters:
      `domainFile` - `DomainFile` to which the URL refers.
      `url` - URL which was used to retrieve the specified `domainFile`
      `monitor` - task monitor
    Throws:
      `IOException` - if an IO error occurs
      `CancelledException` - if task is cancelled

  - ### processResult

    public void processResult(DomainFolder domainFolder, URL url, TaskMonitor monitor) throws IOException, CancelledException
    Description copied from interface: `GhidraURLResultHandler`
    Process the specified `domainFolder` query result. Dissemination of the `domainFolder` 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 `domainFolder` instance will become invalid.
    Specified by:
      `processResult` in interface `GhidraURLResultHandler`
    Parameters:
      `domainFolder` - `DomainFolder` to which the URL refers.
      `url` - URL which was used to retrieve the specified `domainFolder`
      `monitor` - task monitor
    Throws:
      `IOException` - if an IO error occurs
      `CancelledException` - if task is cancelled

  - ### handleError

    public void handleError(String title, String message, URL url, IOException cause) throws IOException
    Description copied from interface: `GhidraURLResultHandler`
    Handle error which occurs during query operation.
    Specified by:
      `handleError` in interface `GhidraURLResultHandler`
    Parameters:
      `title` - error title
      `message` - error detail
      `url` - URL which was used for query
      `cause` - cause of error (may be null)
    Throws:
      `IOException` - may be thrown if handler decides to propogate error