Examples of VFSFile


Examples of com.ibm.sbt.playground.vfs.VFSFile

    return (JavaSnippet)super.load(root);
  }

  @Override
  public Asset createAsset(VFSFile root) throws IOException {
    VFSFile parent = getParentFile(root);
    String jsp = loadResource(parent,"jsp");
    String docHtml = loadResource(parent,"doc.html");
    JavaSnippet s = (JavaSnippet)new JavaSnippet();
    s.setJsp(jsp);
    s.setJspPath("/samples/java"+parent.getPath()+"/"+getName()+".jsp"); // TODO read the base part of the directory from the VFS
    s.setDocHtml(docHtml);
    return s;
  }
View Full Code Here

Examples of com.ibm.sbt.playground.vfs.VFSFile

  }

  public String readGlobalProperties(VFS vfs) throws IOException {
    if(properties==null) {
      // Look for a resource
      VFSFile f = getFile(vfs).getFile(GLOBAL_PROPERTIES);
      if(f!=null) {
        InputStream is = f.getInputStream();
        if(is!=null) {
          try {
            properties = StreamUtil.readString(is);
          } finally {
            StreamUtil.close(is);
View Full Code Here

Examples of com.ibm.sbt.playground.vfs.VFSFile

      String format = getFormat(request);

      String str = null;
      RootNode rootNode = SnippetFactory.getJsSnippets(getServletContext(), request);
      if (unid != null && unid.length() > 0) {
        VFSFile rootFile = SnippetFactory.getJsRootFile(getServletContext());
        JSSnippet snippet = (JSSnippet) rootNode.loadAsset(rootFile, unid);
        if (snippet == null) {
          service400(request, response, "Invalid unid: {0}", unid);
          return;
        }
View Full Code Here

Examples of com.ibm.sbt.playground.vfs.VFSFile

    return (XPagesSnippet)super.load(root);
  }

  @Override
  public Asset createAsset(VFSFile root) throws IOException {
    VFSFile parent = getParentFile(root);
    String xsp = loadResource(parent,"xsp");
    String docHtml = loadResource(parent,"doc.html");
    XPagesSnippet s = (XPagesSnippet)new XPagesSnippet();
    s.setXsp(xsp);
    s.setDocHtml(docHtml);
View Full Code Here

Examples of com.ibm.sbt.playground.vfs.VFSFile

    return (JSSnippet)super.load(root);
  }

  @Override
  public Asset createAsset(VFSFile root) throws IOException {
    VFSFile parent = getParentFile(root);
    String html = loadResource(parent,"html");
    String docHtml = loadResource(parent,"doc.html");
    String js = loadResource(parent,"js");
    String css = loadResource(parent,"css");
    JSSnippet s = (JSSnippet)new JSSnippet();
View Full Code Here

Examples of com.ibm.sbt.playground.vfs.VFSFile

//  var gh = new com.ibm.sbt.playground.git.GitImport("https://api.github.com",null,"OpenNTF/SocialSDK") 
  public void browse(String path) throws Exception {
    GitVFS vfs = new GitVFS("https://api.github.com/repos/OpenNTF/SocialSDK/contents/samples/j2ee/com.ibm.sbt.sample.web/WebContent/js/","priand","xxxxxx");
   
    VFSFile f = vfs.getRoot().getChild("Smartcloud").getChild("Profiles").getChild("Get About.js");
    System.out.println("File:"+f.getName());
    InputStream is = f.getInputStream();
    try {
      FastStringBuffer fb = new FastStringBuffer();
      fb.append(new InputStreamReader(is));
      String s = fb.toString();
      System.out.println(s);
View Full Code Here

Examples of com.ibm.sbt.playground.vfs.VFSFile

    if(level>2) {
      return;
    }
    VFSFile[] files = file.getChildren();
    for(int i=0; i<files.length; i++) {
      VFSFile f = files[i];
      StringBuilder b = new StringBuilder();
      for(int ll=0; ll<level; ll++) {
        b.append("  ");
      }
      if(f.isFolder()) {
        b.append("[+]");
      }
      b.append(f.getName()+", "+f.getPath());
      System.out.println(b.toString());
      if(f.isFolder()) {
        browse(f, level+1);
      }
    }
  }
View Full Code Here

Examples of com.ibm.sbt.playground.vfs.VFSFile

    return (GadgetSnippet)super.load(root);
  }

  @Override
  public Asset createAsset(VFSFile root) throws IOException {
    VFSFile parent = getParentFile(root);

    // Look for a spec.json
    String spec = loadFile(parent,"spec.json");
    if(StringUtil.isNotEmpty(spec)) {
      GadgetSnippet s = (GadgetSnippet)new GadgetSnippet();
View Full Code Here

Examples of com.ibm.sbt.playground.vfs.VFSFile

    String s = getName() + "." + ext;
    return loadFile(parent, s);
  }

  protected String loadFile(VFSFile parent, String fileName) throws IOException {
    VFSFile f = parent.getFile(fileName);
    return loadFile(f);
  }
View Full Code Here

Examples of com.ibm.sbt.playground.vfs.VFSFile

    return (APIDescription)super.load(root);
  }

  @Override
  public Asset createAsset(VFSFile root) throws IOException {
    VFSFile parent = getParentFile(root);
    String json = loadResource(parent,"json");
    APIDescription s = (APIDescription)new APIDescription();
    s.setJson(json);
    return s;
  }
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.