use of com.amazonaws.services.s3.internal.XmlWriter in project aws-sdk-android by aws-amplify.
the class ObjectTaggingXmlFactory method convertToXmlByteArray.
public byte[] convertToXmlByteArray(ObjectTagging tagging) {
XmlWriter writer = new XmlWriter();
writer.start("Tagging").start("TagSet");
for (Tag tag : tagging.getTagSet()) {
writer.start("Tag");
writer.start("Key").value(tag.getKey()).end();
writer.start("Value").value(tag.getValue()).end();
// </Tag>
writer.end();
}
// </TagSet>
writer.end();
// </Tagging>
writer.end();
return writer.getBytes();
}
use of com.amazonaws.services.s3.internal.XmlWriter in project aws-sdk-android by aws-amplify.
the class RequestPaymentConfigurationXmlFactory method convertToXmlByteArray.
/**
* Converts the specified request payment configuration into an XML byte
* array to send to Amazon S3. Sample XML: <RequestPaymentConfiguration
* xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <Payer>Requester</Payer>
* </RequestPaymentConfiguration>
*
* @param requestPaymentConfiguration The request payment configuration
* request to convert..
* @return The XML byte array representation.
*/
public byte[] convertToXmlByteArray(RequestPaymentConfiguration requestPaymentConfiguration) {
XmlWriter xml = new XmlWriter();
xml.start("RequestPaymentConfiguration", "xmlns", Constants.XML_NAMESPACE);
Payer payer = requestPaymentConfiguration.getPayer();
if (payer != null) {
XmlWriter payerDocumentElement = xml.start("Payer");
payerDocumentElement.value(payer.toString());
payerDocumentElement.end();
}
xml.end();
return xml.getBytes();
}
Aggregations