forked from jtu100/JungleDiskSourceExample
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ListBucketResponse.cs
53 lines (48 loc) · 1.69 KB
/
ListBucketResponse.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// This software code is made available "AS IS" without warranties of any
// kind. You may copy, display, modify and redistribute the software
// code either by itself or as incorporated into your code; provided that
// you do not remove any proprietary notices. Your use of this software
// code is at your own risk and you waive any claim against Amazon
// Digital Services, Inc. or its affiliates with respect to your use of
// this software code. (c) 2006 Amazon Digital Services, Inc. or its
// affiliates.
using System;
using System.Collections;
using System.Net;
using System.Text;
using System.Xml;
namespace com.amazon.s3
{
public class ListBucketResponse : Response
{
private ArrayList entries;
public ArrayList Entries
{
get
{
return entries;
}
}
public ListBucketResponse(WebRequest request) :
base(request)
{
entries = new ArrayList();
string rawBucketXML = Utils.slurpInputStream(response.GetResponseStream());
XmlDocument doc = new XmlDocument();
doc.LoadXml( rawBucketXML );
foreach (XmlNode node in doc.ChildNodes)
{
if (node.Name.Equals("ListBucketResult"))
{
foreach (XmlNode child in node.ChildNodes)
{
if (child.Name.Equals("Contents"))
{
entries.Add( new ListEntry(child) );
}
}
}
}
}
}
}