C# Class Google.PowerShell.CloudStorage.BucketModel

This class maintains a local description of the objects in a bucket. It is used by the GoogleCloudStorageProvider to prevent redundant service calls e.g. to discover if an object exists. It keeps track of real objects, which we treat as files, and of name prefixes, which act like folders. A real object named "myFolder/" will be both a prefix "myFolder" and an object "myFolder/".
显示文件 Open project: GoogleCloudPlatform/google-cloud-powershell Class Usage Examples

Public Methods

Method Description
AddObject ( Google.Apis.Storage.v1.Data.Object gcsObject ) : void

Adds or updates a Google Cloud Storage object to the model.

BucketModel ( string bucket, StorageService service ) : System.Collections.Generic

Initializes the bucket model.

GetGcsObject ( string objectName ) : Google.Apis.Storage.v1.Data.Object

Gets the Google Cloud Storage object of a given object name.

HasChildren ( string objectName ) : bool
IsContainer ( string objectName ) : bool

Checks to see if the given object is a folder.

IsReal ( string objectName ) : bool

Checks if the given object is a real object. An object could "exist" but not be "real" if it is a prefix for another object (a logical folder that is not "real").

ObjectExists ( string objectName ) : bool

Checks if an object exists. If the model did not read all of the objects during its last update, it may make a service call if the object is not found in its data.

PopulateModel ( ) : void

Gets a clean set of data from the service. If the bucket has more than a single page of objects, the model will only take the first page.

Method Details

AddObject() public method

Adds or updates a Google Cloud Storage object to the model.
public AddObject ( Google.Apis.Storage.v1.Data.Object gcsObject ) : void
gcsObject Google.Apis.Storage.v1.Data.Object The Google Cloud Storage object to add or update.
return void

BucketModel() public method

Initializes the bucket model.
public BucketModel ( string bucket, StorageService service ) : System.Collections.Generic
bucket string The name of the bucket this models.
service StorageService The storage service used to maintain the model.
return System.Collections.Generic

GetGcsObject() public method

Gets the Google Cloud Storage object of a given object name.
public GetGcsObject ( string objectName ) : Google.Apis.Storage.v1.Data.Object
objectName string
return Google.Apis.Storage.v1.Data.Object

HasChildren() public method

public HasChildren ( string objectName ) : bool
objectName string
return bool

IsContainer() public method

Checks to see if the given object is a folder.
public IsContainer ( string objectName ) : bool
objectName string The name of the object to check.
return bool

IsReal() public method

Checks if the given object is a real object. An object could "exist" but not be "real" if it is a prefix for another object (a logical folder that is not "real").
public IsReal ( string objectName ) : bool
objectName string The name of the object to check.
return bool

ObjectExists() public method

Checks if an object exists. If the model did not read all of the objects during its last update, it may make a service call if the object is not found in its data.
public ObjectExists ( string objectName ) : bool
objectName string
return bool

PopulateModel() public method

Gets a clean set of data from the service. If the bucket has more than a single page of objects, the model will only take the first page.
public PopulateModel ( ) : void
return void