Examples of VFSFile


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

   * @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

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

   * @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

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","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

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

  }

  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

      }
    } 
  }
  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

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

   * @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

Examples of org.sd_network.vfs.db.VfsFile

            printUsage(e.getMessage());
            return;
        }

        String dirName = commandLine.getArgs()[0];
        VfsFile parent = session.getCurrentDirectory();

        try {
            VfsFile targetFile = null;
            if (dirName.equals("..")) {
                if (parent.getParentID().equals("-1"))
                    return;
                targetFile = vfsService.getVfsFile(
                        sessionID, parent.getParentID());
            } else {
                targetFile = vfsService.getVfsFile(
                        sessionID, parent.getID(), dirName);
            }
            if (targetFile == null) {
                System.out.println(
                        "ERROR: [" + dirName + "] not found.");
                return;
            }
            if (targetFile.getType() != VfsFile.FileType.DIRECTORY) {
                System.out.println(
                        "ERROR: [" + dirName + "] is not directory.");
                return;
            }
            session.setCurrentDirectory(targetFile);
View Full Code Here

Examples of org.sd_network.vfs.db.VfsFile

        try {
            VfsService vfsService = VfsContext.getService();
            session.setSessionID(vfsService.login(loginName, password));
            String sessionID = session.getSessionID();
            VfsFile home = vfsService.getVfsFile(sessionID, "-1", "Home");
            if (home == null)
                throw new IllegalStateException(
                        "User home directory not found.");
            session.setCurrentDirectory(home);
            System.out.println("SessionID = " + session.getSessionID());
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.