title: Customizing ResourceBundle file formats for getBundle()?
body: <p>Is there a way to alter the file format &amp; name formatting for a ResourceBundle? This probably sounds like a fairly pointless goal but in essence I want to change it so that instead of looking for:</p>
  
  <pre><code>   &gt; baseName + "_" + language + "_" + country + ".properties"
  </code></pre>
  
  <p>It will look for:</p>
  
  <pre><code>   &gt; language + "_" + country + ".specifiedformat"
  </code></pre>
  
  <p>I'm making a small program and would like to put each locale into a single file with a different file format to .properties, simply using a specific locale as the default.</p>
  
  <p>I've experimented around with ResourceBundle.Control but haven't had any luck. Just for the file format part I'm trying to extend ResourceBundle &amp; Control such that I can declare a new format. getControl is final so can't really do anything there easily.</p>
  
  <pre><code>   public static class MyControl extends Control {
  
       public static final List&lt;String&gt; FORMAT_MYFORMAT
            = Collections.unmodifiableList(Arrays.asList("java.myformat",
                                                   "java.class",
                                                   "java.properties"));
  
      @Override
      public List&lt;String&gt; getFormats(String baseName) {
          if (baseName == null) {
              throw new NullPointerException();
           }
           return FORMAT_MYFORMAT;
        }
      }
  </code></pre>
  
  <p>I don't know if what I'm trying is anywhere close to the mark. I can mostly get my head around the methods in <code>ResourceBundle</code> just not everything as a whole.</p>
  
  <p>Thanks.</p>