Examples of contentAsString()


Examples of fi.luomus.commons.http.HttpClientService.contentAsString()

  private static void httpClientExample() {
    HttpClientService client = null;
    try {
      client = new HttpClientService();
      String content = client.contentAsString(new HttpGet("http://www.google.com"));
      assert(content.length() > 0);
    } catch (Exception e) {
      e.printStackTrace();
    } finally {
      if (client != null) client.close();
View Full Code Here

Examples of play.vfs.VirtualFile.contentAsString()

                Matcher m = Pattern.compile("<<<\\s*\\{([^}]+)}\\s*").matcher(value.toString());
                m.find();
                String file = m.group(1);
                VirtualFile f = Play.getVirtualFile(file);
                if (f != null && f.exists()) {
                    serialized.put(prefix + "." + key.toString(), new String[]{f.contentAsString()});
                }
            } else {
                serialized.put(prefix + "." + key.toString(), new String[]{value.toString()});
            }
        }
View Full Code Here

Examples of play.vfs.VirtualFile.contentAsString()

        if (!urlPath.endsWith("/"))
            urlPath = urlPath + "/";
        // add version info
        VirtualFile vf = Play.getVirtualFile(".version");
        if (null != vf) {
            String v = vf.contentAsString();
            urlPath = urlPath + v + "/";
        }
        if (urlPath.startsWith("/")) {
            return urlPath.startsWith(ctxPath) ? urlPath : ctxPath + urlPath;
        } else {
View Full Code Here

Examples of play.vfs.VirtualFile.contentAsString()

                path = rootDir + File.separator + resourceDir + File.separator
                        + fn;
            }
            VirtualFile vf = VirtualFile.search(Play.roots, path);
            if (null != vf) {
                sb.append(vf.contentAsString());
            }
        }
        return sb.toString();
    }
}
View Full Code Here

Examples of play.vfs.VirtualFile.contentAsString()

                Matcher m = Pattern.compile("<<<\\s*\\{([^}]+)}\\s*").matcher(value.toString());
                m.find();
                String file = m.group(1);
                VirtualFile f = Play.getVirtualFile(file);
                if (f != null && f.exists()) {
                    serialized.put(prefix + "." + key.toString(), new String[]{f.contentAsString()});
                }
            } else {
                serialized.put(prefix + "." + key.toString(), new String[]{value.toString()});
            }
        }
View Full Code Here

Examples of play.vfs.VirtualFile.contentAsString()

                Matcher m = Pattern.compile("<<<\\s*\\{([^}]+)}\\s*").matcher(value.toString());
                m.find();
                String file = m.group(1);
                VirtualFile f = Play.getVirtualFile(file);
                if (f != null && f.exists()) {
                    serialized.put(prefix + "." + key.toString(), new String[]{f.contentAsString()});
                }
            } else {
                serialized.put(prefix + "." + key.toString(), new String[]{value.toString()});
            }
        }
View Full Code Here

Examples of play.vfs.VirtualFile.contentAsString()

                Matcher m = Pattern.compile("<<<\\s*\\{([^}]+)}\\s*").matcher(value.toString());
                m.find();
                String file = m.group(1);
                VirtualFile f = Play.getVirtualFile(file);
                if (f != null && f.exists()) {
                    serialized.put(prefix + "." + key.toString(), new String[]{f.contentAsString()});
                }
            } else {
                serialized.put(prefix + "." + key.toString(), new String[]{value.toString()});
            }
        }
View Full Code Here

Examples of play.vfs.VirtualFile.contentAsString()

            String renderedYaml = null;
            if(loadAsTemplate){
                renderedYaml = TemplateLoader.load(yamlFile).render();
            }else{
                renderedYaml = yamlFile.contentAsString();
            }

            Yaml yaml = new Yaml();
            Object o = yaml.load(renderedYaml);
            if (o instanceof LinkedHashMap<?, ?>) { 
View Full Code Here

Examples of play.vfs.VirtualFile.contentAsString()

                Matcher m = Pattern.compile("<<<\\s*\\{([^}]+)}\\s*").matcher(value.toString());
                m.find();
                String file = m.group(1);
                VirtualFile f = Play.getVirtualFile(file);
                if (f != null && f.exists() && !f.isDirectory()) {
                    serialized.put(prefix + "." + key.toString(), new String[]{f.contentAsString()});
                }
            } else {
                serialized.put(prefix + "." + key.toString(), new String[]{value.toString()});
            }
        }
View Full Code Here

Examples of play.vfs.VirtualFile.contentAsString()

    VirtualFile css = WidgetManager.findCSS(pkgName);
    if (css == null)
      notFound();
    else {
      response.contentType = "text/css";
      renderText(css.contentAsString());
    }
  }

  public static void scripts(String pkgName) throws Exception {
    VirtualFile js = WidgetManager.findJS(pkgName);
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.