com.vmware.vim25.mo.samples.storage.SearchDatastore.class Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vijava Show documentation
Show all versions of vijava Show documentation
Java API for accessing VMWare web services API
The newest version!
???? 2U 3com/vmware/vim25/mo/samples/storage/SearchDatastore java/lang/Object ()V Code
LineNumberTable LocalVariableTable this 5Lcom/vmware/vim25/mo/samples/storage/SearchDatastore; main ([Ljava/lang/String;)V
Exceptions java/lang/Exception java/lang/System out Ljava/io/PrintStream; 7Usage: java SearchDatastore
java/io/PrintStream println (Ljava/lang/String;)V " #com/vmware/vim25/mo/ServiceInstance $ java/net/URL
# &
! ( ) 6(Ljava/net/URL;Ljava/lang/String;Ljava/lang/String;Z)V +
10.20.143.205 - [storage1 (2)]
! / 0 1
getRootFolder ()Lcom/vmware/vim25/mo/Folder; 3 &com/vmware/vim25/mo/InventoryNavigator
2 5 6 &(Lcom/vmware/vim25/mo/ManagedEntity;)V 8
HostSystem
2 : ; < searchManagedEntity I(Ljava/lang/String;Ljava/lang/String;)Lcom/vmware/vim25/mo/ManagedEntity; > com/vmware/vim25/mo/HostSystem @ Host not found
! B C D getServerConnection (()Lcom/vmware/vim25/mo/ServerConnection;
F H G $com/vmware/vim25/mo/ServerConnection I logout
= K L M getDatastoreBrowser ,()Lcom/vmware/vim25/mo/HostDatastoreBrowser; O %print out the names of the datastores
Q S R (com/vmware/vim25/mo/HostDatastoreBrowser T U
getDatastores "()[Lcom/vmware/vim25/mo/Datastore; W java/lang/StringBuilder Y
datastore[
V &
V \ ] ^ append (I)Ljava/lang/StringBuilder; ` ]:
V b ] c -(Ljava/lang/String;)Ljava/lang/StringBuilder;
V e f g toString ()Ljava/lang/String;
i k j com/vmware/vim25/mo/Datastore l m getInfo "()Lcom/vmware/vim25/DatastoreInfo; o Name:
q s r com/vmware/vim25/DatastoreInfo t g getName v
FreeSpace:
q x y z getFreeSpace ()J
V | ] } (J)Ljava/lang/StringBuilder; MaxFileSize:
q ? ? z getMaxFileSize ? print out supported query types
Q ? ? ? getSupportedType ()[Lcom/vmware/vim25/FileQuery; ?
FileQuery[ ? ]=
? ? ? getClass ()Ljava/lang/Class;
? s ? java/lang/Class ? /com/vmware/vim25/HostDatastoreBrowserSearchSpec
? ? com/vmware/vim25/FileQuery ? com/vmware/vim25/VmDiskFileQuery
?
? ? ? ? setQuery ([Lcom/vmware/vim25/FileQuery;)V ? com/vmware/vim25/FileQueryFlags
?
? ? ? ? setFileSize (Z)V
? ? ? ? setModification
? ? ? ?
setDetails $(Lcom/vmware/vim25/FileQueryFlags;)V
? ? ? java/lang/Boolean ? ? valueOf (Z)Ljava/lang/Boolean;
? ? ? ? setSearchCaseInsensitive (Ljava/lang/Boolean;)V ? java/lang/String ? sdk*.*
? ? ? setMatchPattern
Q ? ? ? searchDatastoreSubFolders_Task _(Ljava/lang/String;Lcom/vmware/vim25/HostDatastoreBrowserSearchSpec;)Lcom/vmware/vim25/mo/Task;
? ? ? com/vmware/vim25/mo/Task ? g waitForMe ? success
? ? ? ? getTaskInfo ()Lcom/vmware/vim25/TaskInfo;
? ? ? com/vmware/vim25/TaskInfo ? ? getResult ()Ljava/lang/Object; ? 9com/vmware/vim25/ArrayOfHostDatastoreBrowserSearchResults
? ? ? ? $getHostDatastoreBrowserSearchResults 7()[Lcom/vmware/vim25/HostDatastoreBrowserSearchResults; ?
Folder:
? ? ? 2com/vmware/vim25/HostDatastoreBrowserSearchResults ? g
getFolderPath
? ? ? ? getFile ()[Lcom/vmware/vim25/FileInfo; ? Path:
? ? ? com/vmware/vim25/FileInfo ? g getPath ? FileSize:
? ? ? ? getFileSize ()Ljava/lang/Long;
V ? ] ? -(Ljava/lang/Object;)Ljava/lang/StringBuilder; ? Modified:
? ? ? ? getModification ()Ljava/util/Calendar;
? ? ? java/util/Calendar ? getTime ()Ljava/util/Date; com/vmware/vim25/VmDiskFileInfo
printExtraDiskFileInfo $(Lcom/vmware/vim25/VmDiskFileInfo;)V args [Ljava/lang/String; si %Lcom/vmware/vim25/mo/ServiceInstance; hostname Ljava/lang/String;
datastorePath
rootFolder Lcom/vmware/vim25/mo/Folder; host Lcom/vmware/vim25/mo/HostSystem; hdb *Lcom/vmware/vim25/mo/HostDatastoreBrowser; ds [Lcom/vmware/vim25/mo/Datastore; i I di Lcom/vmware/vim25/DatastoreInfo; fqs [Lcom/vmware/vim25/FileQuery; hdbss 1Lcom/vmware/vim25/HostDatastoreBrowserSearchSpec; fqf !Lcom/vmware/vim25/FileQueryFlags; task Lcom/vmware/vim25/mo/Task; obj Ljava/lang/Object; results 5[Lcom/vmware/vim25/HostDatastoreBrowserSearchResults; result 4Lcom/vmware/vim25/HostDatastoreBrowserSearchResults; fis [Lcom/vmware/vim25/FileInfo; j
StackMapTable. com/vmware/vim25/mo/Folder%)4 CapacityKB:
67 ?
getCapacityKb9 ControllerType:
;<