Exemple #1
0
        public FooResponse SaveNewItem(byte[] data, string mimeType, FooCDNAccessor.StorageType storageType)
        {
            FooResponse created = CreateBlob(mimeType);

            if(created.StatusCode == HttpStatusCode.OK)
            {
                string blobId = created.Value as string;

                FooResponse postResult = Post(created.Value as string, data);
                if(postResult.StatusCode == HttpStatusCode.Created)
                {
                    FooResponse putResult = Put(blobId, storageType);
                    if(putResult.StatusCode == HttpStatusCode.NoContent)
                    {
                        //create result has the blobId
                        return created;
                    }
                    else
                    {
                        return putResult;
                    }
                }
                else
                {
                    return postResult;
                }
            }
            else
            {
                return created;
            }
        }
Exemple #2
0
 public FooResponse Put(string blobID, FooCDNAccessor.StorageType type)
 {
     return new FooResponse()
     {
         StatusCode = System.Net.HttpStatusCode.OK
     };
 }
Exemple #3
0
 public FooResponse Put(string blobID, FooCDNAccessor.StorageType type)
 {
     return ServiceManager.Kernel.Get<IFooCDNAccessor>().Put(blobID, type);
 }