Package ghidra.framework.protocol.ghidra
Class GhidraURLResultHandlerAdapter
java.lang.Object
ghidra.framework.protocol.ghidra.GhidraURLResultHandlerAdapter
- All Implemented Interfaces:
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
ConstructorDescriptionConstruct adapter.GhidraURLResultHandlerAdapter
(boolean throwErrorByDefault) Construct adapter with preferred error handling. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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 specifieddomainFile
query result.void
processResult
(DomainFolder domainFolder, URL url, TaskMonitor monitor) Process the specifieddomainFolder
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
handleUnauthorizedAccess
-
Constructor Details
-
GhidraURLResultHandlerAdapter
public GhidraURLResultHandlerAdapter()Construct adapter. IfhandleError(String, String, URL, IOException)
is not overriden all errors are reported viaMsg.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 ifhandleError(String, String, URL, IOException)
is override.- Parameters:
throwErrorByDefault
- if true all errors will be thrown as anIOException
, otherwise error is reported viaMsg.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 specifieddomainFile
query result. Dissemination of thedomainFile
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 thedomainFile
instance will become invalid.- Specified by:
processResult
in interfaceGhidraURLResultHandler
- Parameters:
domainFile
-DomainFile
to which the URL refers.url
- URL which was used to retrieve the specifieddomainFile
monitor
- task monitor- Throws:
IOException
- if an IO error occursCancelledException
- if task is cancelled
-
processResult
public void processResult(DomainFolder domainFolder, URL url, TaskMonitor monitor) throws IOException, CancelledException Description copied from interface:GhidraURLResultHandler
Process the specifieddomainFolder
query result. Dissemination of thedomainFolder
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 thedomainFolder
instance will become invalid.- Specified by:
processResult
in interfaceGhidraURLResultHandler
- Parameters:
domainFolder
-DomainFolder
to which the URL refers.url
- URL which was used to retrieve the specifieddomainFolder
monitor
- task monitor- Throws:
IOException
- if an IO error occursCancelledException
- 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 interfaceGhidraURLResultHandler
- Parameters:
title
- error titlemessage
- error detailurl
- URL which was used for querycause
- cause of error (may be null)- Throws:
IOException
- may be thrown if handler decides to propogate error
-