Package net.pterodactylus.sone.freenet

Examples of net.pterodactylus.sone.freenet.StringBucket


      templateContext.set("core", core);
      templateContext.set("currentSone", soneProperties);
      templateContext.set("currentEdition", core.getUpdateChecker().getLatestEdition());
      templateContext.set("version", SonePlugin.VERSION);
      StringWriter writer = new StringWriter();
      StringBucket bucket = null;
      try {
        template.render(templateContext, writer);
        bucket = new StringBucket(writer.toString(), utf8Charset);
        return new ManifestElement(name, bucket, contentType, bucket.size());
      } catch (TemplateException te1) {
        logger.log(Level.SEVERE, String.format("Could not render template “%s”!", templateName), te1);
        return null;
      } finally {
        Closer.close(writer);
        if (bucket != null) {
          bucket.free();
        }
      }
    }
View Full Code Here

TOP

Related Classes of net.pterodactylus.sone.freenet.StringBucket

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.