private static void checkTrustWorthy(String setter, String val) {
        if (setter == null || val == null) {
            throw new IllegalArgumentException("setter and val must not be null");
        }
        if (setter
                .toLowerCase(Locale.US)
                .contains("trusted")) {
            throw new IllegalArgumentException("Can't call a trusted method via tika-server headers");
        }
        Matcher m = ALLOWABLE_HEADER_CHARS.matcher(val);
        if (!m.find()) {
            throw new IllegalArgumentException("Header val: " + val + " contains illegal characters. " + "Must contain: TikaResource.ALLOWABLE_HEADER_CHARS");
        }
    }
Utility method to set a property on a class via reflection.

@param object the <code>Object</code> to set the property on.
@param key    the key of the HTTP Header.
@param val    the value of HTTP header.
@param prefix the name of the HTTP Header prefix used to find property.
@throws WebApplicationException thrown when field cannot be found.
tika-server/tika-server-core/src/main/java/org/apache/tika/server/core/resource/TikaResource.java