Esempio n. 1
0
        protected bool runGetObjects(string bucket, string name, string objid, long length, long offset, DS3ObjectTypes type, long version)
        {
            var items = GetObjects(bucket, name, objid, length, offset, type, version);

            // Loop through all of the objects in the bucket.
            foreach (var obj in items)
            {
                Console.WriteLine("Object '{0}' | {1} | {2} | {3} ", obj.Name, obj.Version, obj.Type, obj.CreationDate);
            }
            return true;
        }
Esempio n. 2
0
 public IEnumerable<DS3GetObjectsInfo> GetObjects(string bucketName, string objectName, string ds3ObjectId, long length, long offset, DS3ObjectTypes type, long version)
 {
     var request = new Ds3.Calls.GetObjectsRequest()
     {
         BucketId = bucketName,
         ObjectName = objectName,
         ObjectId = ds3ObjectId,
         Length = length,
         Offset = offset,
         ObjectType = type,
         Version = version
     };
     var response = _client.GetObjects(request);
     foreach (var ds3Object in response.Objects)
     {
         yield return ds3Object;
     }
 }
Esempio n. 3
0
 protected GetObjectsRequest WithObjectType(DS3ObjectTypes type)
 {
     this._objectType = type;
     if (type != DS3ObjectTypes.ALL)
     {
         this.QueryParams.Add("type", type.ToString());
     }
     else
     {
         this.QueryParams.Remove("type");
     }
     return this;
 }