Package java.util

Examples of java.util.PropertyResourceBundle


          throw (IOException) ex.getException();
        }
        if (stream != null) {
          try {
            return (defaultEncoding != null ?
                new PropertyResourceBundle(new InputStreamReader(stream, defaultEncoding)) :
                new PropertyResourceBundle(stream));
          }
          finally {
            stream.close();
          }
        }
View Full Code Here


    }
    if (stream != null) {
      try {
        // Only this line is changed to make it to read properties files
        // as UTF-8.
        bundle = new PropertyResourceBundle(new InputStreamReader(stream, "UTF-8"));
      } finally {
        stream.close();
      }
    }
    return bundle;
View Full Code Here

   * @return PropertyResourceBundle
   */
  public PropertyResourceBundle getProperties(){
    if (this.properties == null){
      try {
        this.properties = new PropertyResourceBundle(
            FileLocator.openStream(this.getBundle(),
                new Path(PROPERTIES),false));
      } catch (IOException e) {
        //log error
        e.getMessage();
View Full Code Here

   *
   * @param var Variable name wanted as a String e.g. "ToolName.assembler.llvm"
   * @return String e.g. LLVM assembler
   */
  public static String getPropertyString(String var) {
    PropertyResourceBundle properties = LlvmUIPlugin.getDefault().getProperties();
    return properties.getString(var);
  }
View Full Code Here

    private PropertyResourceBundle getRAS(String res) throws Exception {
        InputStream ras = this.getClass().getResourceAsStream(res);
        if (ras == null){
            return null;
        }
        return new PropertyResourceBundle(ras);
    }
View Full Code Here

            if (defaultPRB == null){
                throw new IOException("Could not find required file: "+res);
            }
        } else if (checkUnexpected) {
            // Check all the keys are in the default props file
            PropertyResourceBundle prb = getRAS(res);
            if (prb == null){
                return;
            }
            final ArrayList<String> list = Collections.list(prb.getKeys());
            Collections.sort(list);
            final boolean mainResourceFile = resname.startsWith("messages");
            for (String key : list) {
                try {
                    String val = defaultPRB.getString(key); // Also Check key is in default
                    if (mainResourceFile && val.equals(prb.getString(key))){
                        System.out.println("Duplicate value? "+key+"="+val+" in "+res);
                        subTestFailures++;
                    }
                } catch (MissingResourceException e) {
                    subTestFailures++;
View Full Code Here

        }
       
        ResourceBundle bundle;
        try
        {
            bundle = new PropertyResourceBundle(
                new FileInputStream(this.propertiesFile));
        }
        catch (IOException e)
        {
            throw new BuildException("Failed to load properties "
View Full Code Here

    Utf8PropertyResourceBundle(PropertyResourceBundle bundle) {
        this.bundle = bundle;
    }

    Utf8PropertyResourceBundle(InputStream inputStream) throws IOException {
        this.bundle = new PropertyResourceBundle(inputStream);
    }
View Full Code Here

    Utf8PropertyResourceBundle(PropertyResourceBundle bundle) {
        this.bundle = bundle;
    }

    Utf8PropertyResourceBundle(InputStream inputStream) throws IOException {
        this.bundle = new PropertyResourceBundle(inputStream);
    }
View Full Code Here

    Utf8PropertyResourceBundle(PropertyResourceBundle bundle) {
        this.bundle = bundle;
    }

    Utf8PropertyResourceBundle(InputStream inputStream) throws IOException {
        this.bundle = new PropertyResourceBundle(inputStream);
    }
View Full Code Here

TOP

Related Classes of java.util.PropertyResourceBundle

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.