Code example for PropertyResourceBundle

0
          inputStream = ClassLoader.getSystemResourceAsStream( filename );
        } 
        // Now get the bundle from the messages files input stream 
        // 
        if ( inputStream != null ) {
          bundle = new PropertyResourceBundle( new InputStreamReader( inputStream, "UTF-8" ) );
          locales.put( filename, bundle );
        } else { 
          throw new MissingResourceException( "Unable to find properties file [" + filename + "]", locale
            .toString(), packageName );
        } 
      } 
      return bundle;
    } catch ( IOException e ) {
      throw new MissingResourceException(
        "Unable to find properties file [" + filename + "] : " + e.toString(), locale.toString(), packageName );
    } finally { 
      if ( inputStream != null ) {
        try { 
          inputStream.close();