3232import java .util .Collection ;
3333import java .util .Collections ;
3434import java .util .HashSet ;
35+ import java .util .List ;
3536import java .util .Set ;
3637
3738public class RangerPluginConfig extends RangerConfiguration {
@@ -62,6 +63,10 @@ public class RangerPluginConfig extends RangerConfiguration {
6263 private Set <String > serviceAdmins = Collections .emptySet ();
6364
6465 public RangerPluginConfig (String serviceType , String serviceName , String appId , String clusterName , String clusterType , RangerPolicyEngineOptions policyEngineOptions ) {
66+ this (serviceType , serviceName , appId , clusterName , clusterType , null , policyEngineOptions );
67+ }
68+
69+ public RangerPluginConfig (String serviceType , String serviceName , String appId , String clusterName , String clusterType , List <File > additionalConfigFiles , RangerPolicyEngineOptions policyEngineOptions ) {
6570 super ();
6671
6772 addResourcesForServiceType (serviceType );
@@ -73,6 +78,16 @@ public RangerPluginConfig(String serviceType, String serviceName, String appId,
7378
7479 addResourcesForServiceName (this .serviceType , this .serviceName );
7580
81+ if (additionalConfigFiles != null ) {
82+ for (File configFile : additionalConfigFiles ) {
83+ try {
84+ addResource (configFile .toURI ().toURL ());
85+ } catch (Throwable t ) {
86+ LOG .warn ("failed to load configurations from {}" , configFile , t );
87+ }
88+ }
89+ }
90+
7691 String trustedProxyAddressString = this .get (propertyPrefix + ".trusted.proxy.ipaddresses" );
7792
7893 if (StringUtil .isEmpty (clusterName )) {
0 commit comments