public static long getLong(String attrName, Map<String, String> runtimeAttributes, Node docElement) {
        String stringValue = getStringValue(attrName, runtimeAttributes, docElement);
        if (stringValue != null) {
            try {
                return Long.parseLong(stringValue);
            } catch (NumberFormatException e) {
                //swallow
            }
        }
        throw new RuntimeException("Need to specify a \"long\" value in -- " + attrName + " -- in commandline or in config file!");
    }
Get a long value.  Try the runtime attributes first and then back off to
the document element.  Throw a RuntimeException if the attribute is not
found or if the value is not parseable as a long.

@param attrName          attribute name to find
@param runtimeAttributes runtime attributes
@param docElement        correct element that should have specified attribute
@return specified long value
tika-batch/src/main/java/org/apache/tika/util/XMLDOMUtil.java