public static Filter getXSRFFilter() { String filterClass = "org.apache.hadoop.security.http.RestCsrfPreventionFilter"; try { Class<? extends Filter> klass = (Class<? extends Filter>) Class.forName(filterClass); Filter f = klass.newInstance(); LOG.debug("Filter {} found, using as-is.", filterClass); return f; } catch (Exception e) { // ClassNotFoundException, InstantiationException, IllegalAccessException // Class could not be init-ed, use our local copy LOG.debug("Unable to use {}, got exception {}. Using internal shims impl of filter.", filterClass, e.getClass().getName()); } return Utils.constructXSRFFilter(); }
public static Filter getXSRFFilter() { String filterClass = "org.apache.hadoop.security.http.RestCsrfPreventionFilter"; try { Class<? extends Filter> klass = (Class<? extends Filter>) Class.forName(filterClass); Filter f = klass.newInstance(); LOG.debug("Filter {} found, using as-is.", filterClass); return f; } catch (Exception e) { // ClassNotFoundException, InstantiationException, IllegalAccessException // Class could not be init-ed, use our local copy LOG.debug("Unable to use {}, got exception {}. Using internal shims impl of filter.", filterClass, e.getClass().getName()); } return Utils.constructXSRFFilter(); }