Interface ResourceFinder.ResourceFinderCallback

All Known Implementing Classes:
ResourceFinder.DisplayResourceFinderCallback, ResourceFinder.HashingResourceFinderCallback
Enclosing class:
ResourceFinder

A callback interface used when resources are found using this object
  • Method Details

    • preProcess

      ResourceFinder.ResourceFinderCallbackResult preProcess(String resourceName, long filesize, long timestamp, InputStream inputStream) throws IOException
      This method is only invoked for archive resources, before that archive has been read or recursed into. Both archives and standard files will be passed to the postProcess(String, long, long, InputStream, ResourceFinderCallbackResult) method.
      Parameters:
      resourceName - full resource name
      filesize - the size of the (uncompressed) resource, or -1 if this is unknown (some archives do not store this information)
      timestamp - the timestamp of the resource
      inputStream - an inputStream which can be used to retrieve the contents of the resource
      Returns:
      a ResourceFinderCallbackResult which can be used to abort the search or modify/wrap the inputStream being searched.
      Throws:
      IOException
    • postProcess

      ResourceFinder.ResourceFinderCallbackResult postProcess(String resourceName, long filesize, long timestamp, InputStream inputStream, ResourceFinder.ResourceFinderCallbackResult preProcessResult) throws IOException
      This method is invoked for each resource that matches the search criteria specified in the containing ResourceFinder class. This method is not responsible for closing the supplied inputStream.
      Parameters:
      resourceName - full resource name
      filesize - the size of the (uncompressed) resource, or -1 if this is unknown (some archives do not store this information)
      timestamp - the timestamp of the resource
      inputStream - an inputStream which can be used to retrieve the contents of the resource
      Returns:
      a ResourceFinderCallbackResult which can be used to abort the search
      Throws:
      IOException - if an operation on the inputStream fails