Class GhidraURLWrappedContent

java.lang.Object
ghidra.framework.protocol.ghidra.GhidraURLWrappedContent

public class GhidraURLWrappedContent extends Object
GhidraURLWrappedContent provides controlled access to a Ghidra folder/file associated with a Ghidra URL. It is important to note the issuance of this object does not guarantee existence of the requested resource. Any object obtained via the getContent method must be released via the release method. The following rules should be followed when using domain folder and files obtained.
  1. The getContent method may only be invoked once per consumer
  2. The content must be released when no longer in-use, however it should not be released until any derivative domain folders and files are no longer in use as well.
  3. A read-only or immutable domain object may remain open while the associated domain file/folder is released.
  • Constructor Details

  • Method Details

    • getContent

      public Object getContent(Object consumer) throws IOException, FileNotFoundException
      Get the domain folder or file associated with the Ghidra URL. The consumer is responsible for releasing the content object via the release method when it is no longer in use (see release(Object, Object)}).
      Parameters:
      consumer - object which is responsible for releasing the content
      Returns:
      domain file or folder
      Throws:
      IOException - if an IO error occurs
      FileNotFoundException - if the Ghidra URL does no correspond to a folder or file within the Ghidra repository/project.
      See Also:
    • release

      public void release(Object content, Object consumer)
      Indicates the content object previously obtained from this wrapper is no longer in-use and the underlying connection may be closed. A read-only or immutable domain object may remain open and in-use after its associated domain folder/file has been released.
      Parameters:
      content - object obtained via getContent(Object)
      consumer - object consumer which was specified to getContent(Object)