Simplify creating a blob from this...
BlobProperties blobProperties = new BlobProperties(strBlobName);
FileStream stream = new FileStream(strFilePath);
BlobContents blobContents = new BlobContents(stream);
objBlobContainer.createBlob(blobProperties, blobContents, fOverwrite);
Be consistent with Blob Stream API terms and point of view (POV)
To put a blob into a container...
Blob objBlob = new Blob(strBlobName)
Stream objStream = FileStream(strFilePath);
objBlob.setContents(Stream objStream);
objBlob.setMetadata(Metadata objMetadata);
objBlobContainer.putBlob(objBlob, fOverwrite);
To get a blob from a container...
Blob objBlob = objBlobContainer.getBlob(strBlobName);
Stream objStream = objBlob.getContents();
Metadata objMetadata = objBlob.getMetadata();
FYI
At the moment, the java blob api is similar to c# blob api. Look at the c# example at
http://www.dreamincode.net/code/snippet4222.htm about creating blob
Get rid classes that use the term *Properties: both ContainerProperties and
BlobProperties.
For Containers, there should be BlobContainer class (which encapsulates its
property values (set/get) and has a Metadata (set/get))
For Blobs, there should be a Blob class, which has (which encapsulates its
property values (set/get) and has a Metadata (set/get) and has a
BlobContent (set/get)).
This is a cleaner OOD and much more inline with the Blob Service API.
To ease the burden upon BlobContainer class, there should be a Blob class.
with:
setMetadata(NameValueCollection)
NameValueCollection getMetadata()
byte[] getContents()
setContents(byte[])