title: How to load a resource bundle from a file resource in Java?
body: <p>I have a file called <code>mybundle.txt</code> in <code>c:/temp</code> -</p>
  
  <p><code>c:/temp/mybundle.txt</code></p>
  
  <p>How do I load this file into a <code>java.util.ResourceBundle</code>? The file is a valid resource bundle.</p>
  
  <p>This does not seem to work:</p>
  
  <pre><code>java.net.URL resourceURL = null;
  
  String path = "c:/temp/mybundle.txt";
  java.io.File fl = new java.io.File(path);
  
  try {
     resourceURL = fl.toURI().toURL();
  } catch (MalformedURLException e) {             
  }           
  
  URLClassLoader urlLoader = new URLClassLoader(new java.net.URL[]{resourceURL});
  java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle( path , 
                  java.util.Locale.getDefault(), urlLoader );
  </code></pre>