def getCanonicalQueryString(self,args_path):
     canonMap = {}
     for key in args_path.keys():
         value = args_path[key] if args_path[key] is not None else ""
         canonMap[Utils.urlencode(str(key))] = Utils.urlencode(str(value))
         pass
     cannoList = sorted(canonMap.iteritems(),key = lambda d:d[0])
     queryStr = ""
     i = 0
     for val in cannoList:
         if i != 0:
             queryStr += "&"
         queryStr += val[0] + "=" + val[1]
         i = 1
         pass
     return queryStr
    def load_xml_file(self, xml):
        
        root = ET.fromstring(xml)  #获取xml文件的根节点root       

        self.name = self.find_item(root, '{0}Name'.format(ListObjects.NS))
        self.prefix = self.find_item(root, '{0}Prefix'.format(ListObjects.NS))      
        self.marker = self.find_item(root, '{0}Marker'.format(ListObjects.NS))
        self.delimiter = self.find_item(root, '{0}Delimiter'.format(ListObjects.NS))
        self.max_keys = self.find_item(root, '{0}MaxKeys'.format(ListObjects.NS))
        is_truncated = self.find_item(root, '{0}IsTruncated'.format(ListObjects.NS))
        self.is_truncated = self.convert_bool_value(is_truncated)
        self.next_marker = self.find_item(root, '{0}NextMarker'.format(ListObjects.NS))
        
        #获取对象key的相关信息,在Contents节点中
        contents = root.findall('{0}Contents'.format(ListObjects.NS))
        if contents is not None:
            for node in contents:
                key = self.find_item(node, '{0}Key'.format(ListObjects.NS))
                t = self.find_item(node, '{0}LastModified'.format(ListObjects.NS))
                lastmodified = Utils.transfer_date(t)
                etag = self.find_item(node, '{0}ETag'.format(ListObjects.NS))
                size  = long(self.find_item(node, '{0}Size'.format(ListObjects.NS)))
                storage = self.find_item(node, '{0}StorageClass'.format(ListObjects.NS))
            
                #获取Owner相关信息                
                owner_id = self.find_item(node, './/{0}ID'.format(ListObjects.NS))
                owner_name = self.find_item(node, './/{0}DisplayName'.format(ListObjects.NS))
                owner = Owner(owner_id, owner_name)  #创建Owner对象
        
                key_entry = Content(key, lastmodified, etag, size, owner,storage)
                self.key_entries.append(key_entry)  #将对象添加到对象列表中
                self.keyslist.append(key_entry.key) #将对象名添加到列表中

        #获取CommonPrefixes的相关信息
        prefixes = root.findall('{0}CommonPrefixes'.format(ListObjects.NS))
        if prefixes is not None: 
            for p in prefixes:
                pre = self.find_item(p, '{0}Prefix'.format(ListObjects.NS))
                commonprefix = CommonPrefix(pre)                
                self.commonprefix_entries.append(commonprefix)