コード例 #1
0
ファイル: ListEntry.cs プロジェクト: njmube/AmazonS3DA
 public ListEntry(XmlNode node)
 {
     foreach (XmlNode child in node.ChildNodes)
     {
         if (child.Name.Equals("Key"))
         {
             key = Utils.getXmlChildText(child);
         }
         else if (child.Name.Equals("LastModified"))
         {
             string value = Utils.getXmlChildText(child);
             lastModified = Utils.parseDate(value);
         }
         else if ( child.Name.Equals("ETag" ) ) {
             etag = Utils.getXmlChildText(child);
         }
         else if ( child.Name.Equals("Size" ) )
         {
             size = long.Parse( Utils.getXmlChildText( child ) );
         }
         else if ( child.Name.Equals( "Owner" ) )
         {
             owner = new Owner( child );
         }
         else if ( child.Name.Equals( "StorageClass" ) )
         {
             storageClass = Utils.getXmlChildText( child );
         }
     }
 }
コード例 #2
0
        public ListAllMyBucketsResponse( WebRequest request )
            : base(request)
        {
            buckets = new ArrayList();
            string rawBucketXML = Utils.slurpInputStreamAsString( response.GetResponseStream() );

            XmlDocument doc = new XmlDocument();
            doc.LoadXml( rawBucketXML );
            foreach (XmlNode node in doc.ChildNodes)
            {
                if (node.Name.Equals("ListAllMyBucketsResult"))
                {
                    foreach (XmlNode child in node.ChildNodes)
                    {
                        if (child.Name.Equals("Owner"))
                        {
                            owner = new Owner(child);
                        }
                        else if (child.Name.Equals("Buckets"))
                        {
                            foreach (XmlNode bucket in child.ChildNodes)
                            {
                                if (bucket.Name.Equals("Bucket"))
                                {
                                    buckets.Add(new Bucket(bucket));
                                }
                            }
                        }
                    }
                }
            }
        }
コード例 #3
0
ファイル: ListEntry.cs プロジェクト: njmube/AmazonS3DA
 public ListEntry( string key,
                   DateTime lastModified,
                   string etag,
                   long size,
                   string storageClass,
                   Owner owner)
 {
     this.key = key;
     this.lastModified = lastModified;
     this.etag = etag;
     this.size = size;
     this.storageClass = storageClass;
     this.owner = owner;
 }