%Net.Cloud.Storage.Client
class %Net.Cloud.Storage.Client extends %Library.RegisteredObject
Property Inventory
Method Inventory
- BlobExists()
- BucketExists()
- Close()
- CopyBlob()
- CreateBucket()
- CreateClient()
- DeleteBlob()
- DeleteBucket()
- DownloadBlobToFile()
- DownloadBlobToStream()
- DownloadBlobToString()
- GetBlobInfo()
- GetBucketInfo()
- IsBucketPublicAccessible()
- IsBucketWritable()
- ListBlobs()
- ListBuckets()
- MoveBlob()
- SingleDownloadBlobToFile()
- SingleDownloadBlobToStream()
- SingleDownloadBlobToString()
- SingleUploadBlobFromFile()
- SingleUploadBlobFromStream()
- SingleUploadBlobFromString()
- UploadBlobFromFile()
- UploadBlobFromStream()
- UploadBlobFromString()
Parameters
parameter BUFFERLENGTH = 32000;
Properties
property gateway as %External.JavaGateway;
Connection to a Java Gateway
Property methods: gatewayGet(), gatewayGetSwizzled(), gatewayIsValid(), gatewayNewObject(), gatewaySet()
property jclient as %Net.Remote.Object;
Remote Java client object to Azure, Google or S3
Property methods: jclientGet(), jclientGetSwizzled(), jclientIsValid(), jclientNewObject(), jclientSet()
Methods
Test if a blob exists
Test if a bucket exists
method Close()
Close storage client and disconnect Java gateway
method CopyBlob(sourceBucketName As %String, sourceBlobName As %String, targetBucketName As %String, targetBlobName As %String)
Copy a blob from source to target
method CreateBucket(bucketName As %String)
Create a new bucket
classmethod CreateClient(javaServer As %RawString = "", storageProvider As %Integer, credentialsFile As %String = "", region As %String, Output sc As %Status, endPoint As %String = "") as Client
Factory method to create a cloud storage client.
javaServer: Java gateway name, default to default Java gateway.
storageProvider: Specify storage provider. 0: Amazon S3, 1: Azure Blob, 2: Google Cloud Storage.
credentialsFile: File name containing credentials for specific storage provider.
region: Cloud storage region for specific storage provider.
sc: returning status code.
endPoint: Optional PrivateLink endpoint
Delete a blob from the cloud
method DeleteBucket(bucketName As %String)
Delete a bucket from the cloud
Download a blob from the cloud to a file
method DownloadBlobToStream(bucketName As %String, blobName As %String, blobEncoding As %String = "") as %Stream.Object
Download a blob from the cloud to a stream
blobEncoding name follows Java convention
If blobEncoding = "", the returning stream is %GlobalBinarayStream; otherwise, it is %GlobalCharacterStream.
method DownloadBlobToString(bucketName As %String, blobName As %String, blobEncoding As %String = "") as %String
Download a blob from the cloud to a string
blobEncoding: Blob content encoding, the name follows Java convention.
If blobEncoding = "", treat the blob content as encoded in UTF-8.
Get blob info
method GetBucketInfo(bucketName As %String) as BucketInfo
Get bucket info
Test if a bucket is public accessible
method IsBucketWritable(bucketName As %String)
Test if a bucket is writable
method ListBlobs(bucketName As %String, blobNamePrefix As %String = "", blobNamePattern As %String = "") as %ListOfObjects
List all blobs within a bucket, filtered by blobNamePrefix and blobNamePattern.
bucketName: bucket name
blobNamePrefix: blob name prefix, used to filter the result on the server.
blobNamePattern: blob name pattern, used to filter the result by the client. Support wild cards "?" and "*".
method ListBuckets() as %ListOfObjects
List all buckets
method MoveBlob(sourceBucketName As %String, sourceBlobName As %String, targetBucketName As %String, targetBlobName As %String)
Move a blob from source to target
classmethod SingleDownloadBlobToFile(javaServer As %RawString = "", storageProvider As %Integer, credentialsFile As %String = "", region As %String, endPoint As %String = "", bucketName As %String, blobName As %String, filePath As %String) as %Status
Single method to download blob to file
classmethod SingleDownloadBlobToStream(javaServer As %RawString = "", storageProvider As %Integer, credentialsFile As %String = "", region As %String, endPoint As %String = "", bucketName As %String, blobName As %String, blobEncoding As %String = "", Output toStream As %Stream.Object) as %Status
Single method to download blob to stream
classmethod SingleDownloadBlobToString(javaServer As %RawString = "", storageProvider As %Integer, credentialsFile As %String = "", region As %String, endPoint As %String = "", bucketName As %String, blobName As %String, blobEncoding As %String = "", Output toString As %String) as %Status
Single method to download blob to string
classmethod SingleUploadBlobFromFile(javaServer As %RawString = "", storageProvider As %Integer, credentialsFile As %String = "", region As %String, endPoint As %String = "", bucketName As %String, blobName As %String, filePath As %String) as %Status
Single method to upload blob from file
classmethod SingleUploadBlobFromStream(javaServer As %RawString = "", storageProvider As %Integer, credentialsFile As %String = "", region As %String, endPoint As %String = "", bucketName As %String, blobName As %String, stream As %Stream.Object) as %Status
Single method to upload blob from stream
classmethod SingleUploadBlobFromString(javaServer As %RawString = "", storageProvider As %Integer, credentialsFile As %String = "", region As %String, endPoint As %String = "", bucketName As %String, blobName As %String, content As %String) as %Status
Single method to upload blob from string
Upload a file blob to the cloud
method UploadBlobFromStream(bucketName As %String, blobName As %String, stream As %Stream.Object)
Upload a binary or character stream blob to the cloud
For character stream, its content is converted to UTF-8 first, then uploaded as binary stream.
Upload a string blob to the cloud
String content will be encoded as UTF-8
Inherited Members
Inherited Methods
- %AddToSaveSet()
- %ClassIsLatestVersion()
- %ClassName()
- %ConstructClone()
- %DispatchClassMethod()
- %DispatchGetModified()
- %DispatchGetProperty()
- %DispatchMethod()
- %DispatchSetModified()
- %DispatchSetMultidimProperty()
- %DispatchSetProperty()
- %Extends()
- %GetParameter()
- %IsA()
- %IsModified()
- %New()
- %NormalizeObject()
- %ObjectModified()
- %OriginalNamespace()
- %PackageName()
- %RemoveFromSaveSet()
- %SerializeObject()
- %SetModified()
- %ValidateObject()