public static boolean getThrowOnWriteLimitReached(MultivaluedMap<String, String> httpHeaders) {
        if (httpHeaders.containsKey("throwOnWriteLimitReached")) {
            String val = httpHeaders.getFirst("throwOnWriteLimitReached");
            if ("true".equalsIgnoreCase(val)) {
                return true;
            } else if ("false".equalsIgnoreCase(val)) {
                return false;
            } else {
                throw new IllegalArgumentException("'throwOnWriteLimitReached' must be either 'true' or 'false'");
            }
        }
        return HandlerConfig.DEFAULT_HANDLER_CONFIG.isThrowOnWriteLimitReached();
    }
Use this to call a parser and unify exception handling.
NOTE: This call to parse closes the InputStream. DO NOT surround
the call in an auto-close block.

@param parser       parser to use
@param logger       logger to use
@param path         file path
@param inputStream  inputStream (which is closed by this call!)
@param handler      handler to use
@param metadata     metadata
@param parseContext parse context
@throws IOException wrapper for all exceptions
tika-server/tika-server-core/src/main/java/org/apache/tika/server/core/resource/TikaResource.java