Package org.apache.tapestry.util.text

Examples of org.apache.tapestry.util.text.LocalizedProperties.load()


            __CLOVER_305_0.S[14041]++;InputStream input = propertiesURL.openStream();

            __CLOVER_305_0.S[14042]++;if ((((encoding == null) && (++__CLOVER_305_0.CT[2350] != 0)) || (++__CLOVER_305_0.CF[2350] == 0))){
                __CLOVER_305_0.S[14043]++;localizedResult.load(input);}
            else{
                __CLOVER_305_0.S[14044]++;localizedResult.load(input, encoding);}

            __CLOVER_305_0.S[14045]++;input.close();
        }
        catch (IOException ex)
        {
View Full Code Here


        __CLOVER_305_0.S[7102]++;try
        {
            __CLOVER_305_0.S[7103]++;InputStream input = propertiesURL.openStream();

            __CLOVER_305_0.S[7104]++;if ((((encoding == null) && (++__CLOVER_305_0.CT[1238] != 0)) || (++__CLOVER_305_0.CF[1238] == 0))){
                __CLOVER_305_0.S[7105]++;localizedResult.load(input);}
            else{
                __CLOVER_305_0.S[7106]++;localizedResult.load(input, encoding);}

            __CLOVER_305_0.S[7107]++;input.close();
        }
View Full Code Here

            __CLOVER_305_0.S[7103]++;InputStream input = propertiesURL.openStream();

            __CLOVER_305_0.S[7104]++;if ((((encoding == null) && (++__CLOVER_305_0.CT[1238] != 0)) || (++__CLOVER_305_0.CF[1238] == 0))){
                __CLOVER_305_0.S[7105]++;localizedResult.load(input);}
            else{
                __CLOVER_305_0.S[7106]++;localizedResult.load(input, encoding);}

            __CLOVER_305_0.S[7107]++;input.close();
        }
        catch (IOException ex)
        {
View Full Code Here

          displayNamesManual.load(str, "UTF-8");
        }
        str = ResourceLocatorImpl.tryFindResourceAsStream(logger, context.getResourcesOracle(),
            OVERRIDE_LOCALE_NATIVE_DISPLAY_NAMES);
        if (str != null) {
          displayNamesOverride.load(str, "UTF-8");
        }
      } catch (UnsupportedEncodingException e) {
        // UTF-8 should always be defined
        logger.log(TreeLogger.ERROR, "UTF-8 encoding is not defined", e);
        throw new UnableToCompleteException();
View Full Code Here

    InputStream str = null;
    LocalizedProperties props = new LocalizedProperties();
    try {
      str = ResourceLocatorImpl.tryFindResourceAsStream(logger, resourceOracle, propFile);
      if (str != null) {
        props.load(str, "UTF-8");
        return props;
      }
    } catch (UnsupportedEncodingException e) {
      // UTF-8 should always be defined
      return null;
View Full Code Here

  @SuppressWarnings("unchecked")
  public LocalizedPropertiesResource(InputStream m, GwtLocale locale) {
    super(locale);
    LocalizedProperties props = new LocalizedProperties();
    try {
      props.load(m, Util.DEFAULT_ENCODING);
    } catch (IOException e) {
      throw new RuntimeException("Failed to load " + this.getPath(), e);
    }
    entries = new HashMap<String, MultipleFormEntry>();
    for (Object propEntryObj : props.getPropertyMap().entrySet()) {
View Full Code Here

        if (str != null) {
          displayNamesManual.load(str, "UTF-8");
        }
        str = classLoader.getResourceAsStream(OVERRIDE_LOCALE_NATIVE_DISPLAY_NAMES);
        if (str != null) {
          displayNamesOverride.load(str, "UTF-8");
        }
      } catch (UnsupportedEncodingException e) {
        // UTF-8 should always be defined
        logger.log(TreeLogger.ERROR, "UTF-8 encoding is not defined", e);
        throw new UnableToCompleteException();
View Full Code Here

        File f = new File(propDir, propFile);
        FileInputStream str = null;
        try {
          str = new FileInputStream(f);
          LocalizedProperties props = new LocalizedProperties();
          props.load(str);
          Map<String, String> map = props.getPropertyMap();
          for (Map.Entry<String, String> entry : map.entrySet()) {
            String[] value = split(entry.getValue());
            if ("dateFormats".equals(entry.getKey()) || "timeFormats".equals(entry.getKey())
                || "weekendRange".equals(entry.getKey())) {
View Full Code Here

  @SuppressWarnings("unchecked") // use of raw type from LocalizedProperties
  void generateFromPropertiesFile() throws IOException {
    InputStream propStream = new FileInputStream(resourceFile);
    LocalizedProperties p = new LocalizedProperties();
    p.load(propStream, Util.DEFAULT_ENCODING);
    addFormatters();
    // TODO: Look for a generic version of Tapestry's LocalizedProperties class
    Set<String> keySet = p.getPropertyMap().keySet();
    // sort keys for deterministic results
    String[] keys = keySet.toArray(new String[keySet.size()]);
View Full Code Here

        try
        {
            input = new BufferedInputStream(resourceURL.openStream());

            if (encoding == null)
                wrapper.load(input);
            else
                wrapper.load(input, encoding);

            input.close();
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.