Package com.ibm.sbt.playground.vfs

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


   * @return RootNode of the Snippets.
   */
  private static RootNode getSnippets(ServletContext context, NodeFactory nodeFactory, String path, HttpServletRequest request){
    RootNode root;
    try {
      VFSFile file = getRootFile(context, path);
      root = readAssets(context, file, nodeFactory, request);
    } catch(IOException ex) {
      root = new RootNode();
    }
    return root;
View Full Code Here

   * @return RootNode of the Snippets.
   */
  private static RootNode getSnippets(ServletContext context, NodeFactory nodeFactory, String path, HttpServletRequest request){
    RootNode root;
    try {
      VFSFile file = getRootFile(context, path);
      root = readAssets(context, file, nodeFactory, request);
    } catch(IOException ex) {
      root = new RootNode();
    }
    return root;
View Full Code Here

//  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","gith7934");
   
    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

    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

  }

  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

      }
    } 
  }
  protected int importAssets(ImportSource source, final AsyncAction action) throws Exception {
    VFS vfs=createImportVFS(source);
    VFSFile rootDir=vfs.getRoot();

    AssetBrowser a=new AssetBrowser(rootDir, getNodeFactory()) {
      // Import all the nodes to the DB, regardless of the constraints (endpoints, jslibs...)
      protected boolean includeNode(Properties properties){
        return true;
View Full Code Here

   * @return RootNode of the Snippets.
   */
  private static RootNode getSnippets( NodeFactory nodeFactory, String path){
    RootNode root;
    try {
      VFSFile file = getRootFile(path);
      root = readAssets(file, nodeFactory);
    } catch(IOException ex) {
      root = new RootNode();
    }
    return root;
View Full Code Here

TOP

Related Classes of com.ibm.sbt.playground.vfs.VFSFile

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.