Tuesday, 6 August 2013

OpenStack .NET API , meta data not getting added when passed in with cloudFilesProvider.CreateObjectFromFile

OpenStack .NET API , meta data not getting added when passed in with
cloudFilesProvider.CreateObjectFromFile

Unable to add metadata while creating object with
cloudFilesProvider.CreateObjectFromFile. Is that supported by
cloudFilesProvider.CreateObjectFromFile? Currently i'm doing:
DicMetaData.Add("StoreID", inStrContainerID);
DicMetaData.Add("FileType", instrFileType);
DicMetaData.Add("DateCreated", dTDateCreated.ToString("MM/dd/yyyy
hh:mm:ss.FFF"));
DicMetaData.Add("isProcessed", "0");
DicMetaData.Add("DateProcessed", DateTime.Now.ToString("MM/dd/yyyy
hh:mm:ss.FFF"));
cloudFilesProvider.CreateObjectFromFile(inStrContainerID,
inStrSrcFilePath, strDesFileName, 4096, DicMetaData);
So while calling cloudFilesProvider.CreateObjectFromFile i stepped in all
they way to
RestService.Stream(absoluteUri, method, stream, chunkSize, maxReadLength,
headers, queryStringParameter, requestSettings, progressUpdated);
in StreamRESTRequest method of ProviderBase.cs and here the headers count
was 6 [5 items i added + X-Auth-Token that gets added before
RestService.Stream]
so i know all the items are getting passed to the resquest, but after the
object is created, if i do a get cloudFilesProvider.GetObjectMetaData then
i get a Dictionary back with count 0.
Then i did
cloudFilesProvider.CreateObjectFromFile(inStrContainerID,
inStrSrcFilePath, strDesFileName);
cloudFilesProvider.UpdateObjectMetadata(inStrContainerID, strDesFileName,
DicMetaData);
here if i do a get cloudFilesProvider.GetObjectMetaData i get the added
metadata back in the Dictionary.
So how can this be done better?

No comments:

Post a Comment