org.modeshape.jcr.text

## Class TextExtractorContext

- java.lang.Object
- - org.modeshape.jcr.text.TextExtractorContext

- All Implemented Interfaces:
    TextExtractor.Context

      public final class TextExtractorContext
      extends Object
      implements TextExtractor.Context

  A context for extracting the content.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TextExtractorContext(MimeTypeDetector detector)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `mimeTypeOf(String name, Binary binaryValue)` Determines the mime-type of the given binary value .

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### TextExtractorContext

          public TextExtractorContext(MimeTypeDetector detector)

  - ### Method Detail

    - #### mimeTypeOf

          public String mimeTypeOf(String name,
                          Binary binaryValue)
                            throws RepositoryException,
                                   IOException

      Description copied from interface: `TextExtractor.Context`
      Determines the mime-type of the given binary value .
      Specified by:
        `mimeTypeOf` in interface `TextExtractor.Context`
      Parameters:
        `name` - a symbolic name of the binary value (e.g. the name of a file); may be `null`
        `binaryValue` - a `Binary` instance which represents the binary data; may not be `null`
      Returns:
        either a valid mime-type or `null` if it's not possible to determine the mimetype.
      Throws:
        `RepositoryException` - if there are any problems accessing the binary value from the repository.
        `IOException` - if there are any problems reading bytes from the binary value.

Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.