title: I need to add .drl files at runtime (From an S3 bucket) and supply it to drools rule engine
body: <p>Unable to add rules at runtime through ResourceFactory.newURLResource()
  Also , KnowledgeBase is deprecated or cannot be resolved</p>
  
  <p>I have tried all the snippets from the documentation</p>
  
  <p>public class RuleRunner {</p>
  
  <pre><code>public RuleRunner() {
  }
  
  public void runRules(String[] rules,
                       Object[] facts) throws Exception {
  
      KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
      KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
  
      for ( int i = 0; i &lt; rules.length; i++ ) {
          String ruleFile = rules[i];
          System.out.println( "Loading file: " + ruleFile );
          kbuilder.add( ResourceFactory.newClassPathResource( ruleFile,
                                                              RuleRunner.class ),
                        ResourceType.DRL );
      }
  
      Collection&lt;KnowledgePackage&gt; pkgs = kbuilder.getKnowledgePackages();
      kbase.addKnowledgePackages( pkgs );
      StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
  
      for ( int i = 0; i &lt; facts.length; i++ ) {
          Object fact = facts[i];
          System.out.println( "Inserting fact: " + fact );
          ksession.insert( fact );
      }
  
      ksession.fireAllRules();
  }
  </code></pre>
  
  <p>}</p>
  
  <p>public KieContainer getKieContainer() {</p>
  
  <pre><code>    String drlURL ="https://s3.amazonaws.com/somebucket4/rules.drl";
      KieServices kieServices = KieServices.Factory.get();
      KieFileSystem kieFileSystem = kieServices.newKieFileSystem();
      kieFileSystem.write(ResourceFactory.newUrlResource(drlURL));
      KieBuilder kieBuilder = kieServices.newKieBuilder(kieFileSystem);
      kieBuilder.buildAll();
      KieModule kieModule = kieBuilder.getKieModule();
      return kieServices.newKieContainer(kieModule.getReleaseId());
  }
  </code></pre>