Class FileProfiler

All Implemented Interfaces:
Callable<IFileProcessorFutureResult>

public class FileProfiler extends AbstractProfiler
This class profiles actual files as opposed to extracts e.g. ExtractProfiler. This does _not_ parse files, but does run file type identification and digests the raw bytes.

If the 'file' command is available on the command line, this will also run the FileCommandDetector.

  • Field Details

  • Constructor Details

  • Method Details

    • USAGE

      public static void USAGE()
    • processFileResource

      public boolean processFileResource(FileResource fileResource)
      Description copied from class: FileResourceConsumer
      Main piece of code that needs to be implemented. Clients are responsible for closing streams and handling the exceptions that they'd like to handle.

      Unchecked throwables can be thrown past this, of course. When an unchecked throwable is thrown, this logs the error, and then rethrows the exception. Clients/subclasses should make sure to catch and handle everything they can.

      The design goal is that the whole process should close up and shutdown soon after an unchecked exception or error is thrown.

      Make sure to call FileResourceConsumer.incrementHandledExceptions() appropriately in your implementation of this method.

      Specified by:
      processFileResource in class FileResourceConsumer
      Parameters:
      fileResource - resource to process
      Returns:
      whether or not a file was successfully processed