func (vs *VSphere) GetFolderByPath(ctx context.Context, dc object.Reference, folderPath string) (vmFolderMor types.ManagedObjectReference, err error) {
	Connect(ctx, vs)
	datacenter := object.NewDatacenter(vs.Client.Client, dc.Reference())
	finder := find.NewFinder(datacenter.Client(), false)
	finder.SetDatacenter(datacenter)
	vmFolder, err := finder.Folder(ctx, folderPath)
	if err != nil {
		framework.Logf("Failed to get the folder reference for %s. err: %+v", folderPath, err)
		return vmFolderMor, err
	}
	return vmFolder.Reference(), nil
}
// GetFolderByPath gets the Folder Object Reference from the given folder path
// folderPath should be the full path to folder
GetFolderByPath gets the Folder Object Reference from the given folder path
folderPath should be the full path to folder
// GetFolderByPath gets the Folder Object Reference from the given folder path // folderPath should be the full path to folder
func (vs *VSphere) GetFolderByPath(ctx context.Context, dc object.Reference, folderPath string) (vmFolderMor types.ManagedObjectReference, err error) {
	Connect(ctx, vs)
	datacenter := object.NewDatacenter(vs.Client.Client, dc.Reference())
	finder := find.NewFinder(datacenter.Client(), false)
	finder.SetDatacenter(datacenter)
	vmFolder, err := finder.Folder(ctx, folderPath)
	if err != nil {
		framework.Logf("Failed to get the folder reference for %s. err: %+v", folderPath, err)
		return vmFolderMor, err
	}
	return vmFolder.Reference(), nil
}
func ( vs * VSphere ) GetFolderByPath ( ctx context . Context , dc object . Reference , folderPath string ) ( vmFolderMor types . ManagedObjectReference , err error ) { Connect ( ctx , vs ) datacenter := object . NewDatacenter ( vs . Client . Client , dc . Reference ( ) ) finder := find . NewFinder ( datacenter . Client ( ) , false ) finder . SetDatacenter ( datacenter ) vmFolder , err := finder . Folder ( ctx , folderPath ) if err != nil { framework . Logf ( " " , folderPath , err ) return vmFolderMor , err } return vmFolder . Reference ( ) , nil }
GetFolderByPath gets the Folder Object Reference from the given folder path
folderPath should be the full path to folder
GetFolderByPath gets the Folder Object Reference from the given folder path folderPath should be the full path to folder