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/".
Afficher le fichier Open project: GoogleCloudPlatform/google-cloud-powershell Class Usage Examples

Méthodes publiques

Méthode 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 méthode

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.
Résultat void

BucketModel() public méthode

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.
Résultat System.Collections.Generic

GetGcsObject() public méthode

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

HasChildren() public méthode

public HasChildren ( string objectName ) : bool
objectName string
Résultat bool

IsContainer() public méthode

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

IsReal() public méthode

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.
Résultat bool

ObjectExists() public méthode

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
Résultat bool

PopulateModel() public méthode

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
Résultat void