Prefix Property
Filters the results to return only blobs/containers whose names begin with the specified prefix.
Syntax
azureblob.getPrefix([callback]) azureblob.setPrefix( prefix, [callback])
Default Value
""
Callback
The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).
The callback for the getPrefix([callback]) method is defined as:
function(err, data){ }
'err' is the error that occurred. If there was no error, then 'err' is 'null'.
'data' is the value returned by the method.
The callback for the setPrefix([callback]) method is defined as:
function(err){ }
'err' is the error that occurred. If there was no error, then 'err' is 'null'.
'err' has 2 properties which hold detailed information:
err.code err.message
Remarks
This property is used to filter the results returned by ListBlobs and ListContainers. When set prior to retrieving a blob or container list, only the blobs or containers starting with the specified prefix will be returned.
Prefix is useful for traversing a virtual namespace hierarchy and can work in conjunction with BlobDelimiter.
Note, the Azure Blob Storage does not support hierarchical structures. However blob names can be used to simulate a virtual hierarchical folder structure.
For example, we have blobs with the following names:
MyCompany, MyCompany/Department1, MyCompany/Department2
If we set BlobDelimiter to "/", calling ListBlobs, will return the "MyCompany" blob. The PrefixList event will also fire for "MyCompany/".
If you then wanted to traverse the blobs contained within the "MyCompany/" virtual folder, you can set Prefix to "MyCompany/" and call ListBlobs. The resulting blob list will contain the "MyCompany/Department1" and "MyCompany/Department2" blobs.
This property is not available at design time.
Data Type
String