Examples of HostDatastoreBrowser


Examples of com.vmware.vim25.mo.HostDatastoreBrowser

      System.out.println("Host not found");
      si.getServerConnection().logout();
      return;
    }
   
    HostDatastoreBrowser hdb = host.getDatastoreBrowser();
 
    System.out.println("print out the names of the datastores");
    Datastore[] ds = hdb.getDatastores();
    for(int i=0; ds!=null && i<ds.length; i++)
    {
      System.out.println("datastore["+i+"]:");
      DatastoreInfo di = ds[i].getInfo();
      System.out.println("Name:" + di.getName());
      System.out.println("FreeSpace:" + di.getFreeSpace());
      System.out.println("MaxFileSize:" + di.getMaxFileSize());
    }
   
    System.out.println("print out supported query types");
    FileQuery[] fqs = hdb.getSupportedType();
    for(int i=0; fqs!=null && i<fqs.length; i++)
    {
      System.out.println("FileQuery["+i+"]="
          + fqs[i].getClass().getName());
    }
   
    HostDatastoreBrowserSearchSpec hdbss =
      new HostDatastoreBrowserSearchSpec();
    hdbss.setQuery(new FileQuery[] { new VmDiskFileQuery()});
    FileQueryFlags fqf = new FileQueryFlags();
    fqf.setFileSize(true);
    fqf.setModification(true);
    hdbss.setDetails(fqf);
    hdbss.setSearchCaseInsensitive(false);
    hdbss.setMatchPattern(new String[] {"sdk*.*"});
   
    Task task = hdb.searchDatastoreSubFolders_Task(
        datastorePath, hdbss);
    if(task.waitForMe()==Task.SUCCESS)
    {
      Object obj = task.getTaskInfo().getResult();
      if(obj instanceof ArrayOfHostDatastoreBrowserSearchResults)
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.