Package httl

Examples of httl.Resource


    String path = toPath(name, cur);
    while (cur != null && ! _exists(name, locale, path)) {
      cur = LocaleUtils.getParentLocale(cur);
      path = toPath(name, cur);
    }
    Resource resource = doLoad(name, locale, encoding, path);
    logResourceDirectory(resource);
    return resource;
  }
View Full Code Here


        if (old != null) {
          properties = old;
        }
      }
      try {
        Resource resource = engine.getResource(file);
        if (properties.getLastModified() < resource.getLastModified()) {
          String encoding = (StringUtils.isEmpty(messageEncoding) ? "UTF-8" : messageEncoding);
          properties.load(resource.openStream(), encoding, resource.getLastModified());
        }
      } catch (IOException e) {
        if (logger != null && logger.isErrorEnabled()) {
          logger.error("Failed to load httl message file " + file + " with locale " + locale + ", cause: " + e.getMessage(), e);
        }
View Full Code Here

    locale = cleanLocale(locale);
    Map<Object, Object> cache = this.cache; // safe copy reference
    if (cache == null) {
      return parseTemplate(null, name, locale, encoding, args);
    }
    Resource resource = null;
    long lastModified;
    if (reloadable) {
      resource = loadResource(name, locale, encoding);
      lastModified = resource.getLastModified();
    } else {
      lastModified = Long.MIN_VALUE;
    }
    String key = name;
    if (locale != null || encoding != null) {
View Full Code Here

    return loadResource(name, locale, encoding);
  }

  // Load the resource. (No url clean)
  private Resource loadResource(String name, Locale locale, String encoding) throws IOException {
    Resource resource;
    if (stringLoader.exists(name, locale)) {
      resource = stringLoader.load(name, locale, encoding);
    } else {
      resource = loader.load(name, locale, encoding);
    }
View Full Code Here

TOP

Related Classes of httl.Resource

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.