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
ConstructorsConstructorDescriptionConstruct adapter.GhidraURLResultHandlerAdapter(boolean throwErrorByDefault) Construct adapter with preferred error handling. -
Method Summary
Modifier and TypeMethodDescriptionvoidhandleError(String title, String message, URL url, IOException cause) Handle error which occurs during query operation.voidprocessResult(DomainFile domainFile, URL url, TaskMonitor monitor) Process the specifieddomainFilequery result.voidprocessResult(DomainFolder domainFolder, URL url, TaskMonitor monitor) Process the specifieddomainFolderquery result.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:GhidraURLResultHandlerProcess the specifieddomainFilequery result. Dissemination of thedomainFileinstance 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 thedomainFileinstance will become invalid.- Specified by:
processResultin interfaceGhidraURLResultHandler- Parameters:
domainFile-DomainFileto which the URL refers.url- URL which was used to retrieve the specifieddomainFilemonitor- 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:GhidraURLResultHandlerProcess the specifieddomainFolderquery result. Dissemination of thedomainFolderinstance 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 thedomainFolderinstance will become invalid.- Specified by:
processResultin interfaceGhidraURLResultHandler- Parameters:
domainFolder-DomainFolderto which the URL refers.url- URL which was used to retrieve the specifieddomainFoldermonitor- 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:GhidraURLResultHandlerHandle error which occurs during query operation.- Specified by:
handleErrorin 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
-