Package com.jamesmurty.utils

Examples of com.jamesmurty.utils.XMLBuilder.asString()


            builder
                .e("Comment").t(comment).up()
                .e("Enabled").t("" + enabled);

            httpMethod.setRequestEntity(
                new StringRequestEntity(builder.asString(null), "text/xml", Constants.DEFAULT_ENCODING));

            performRestRequest(httpMethod, 201);

            DistributionHandler handler = (new CloudFrontXmlResponsesSaxParser())
                .parseDistributionResponse(httpMethod.getResponseBodyAsStream());
View Full Code Here


            builder
                .e("Comment").t(comment).up()
                .e("Enabled").t("" + enabled);
           
            httpMethod.setRequestEntity(
                new StringRequestEntity(builder.asString(null), "text/xml", Constants.DEFAULT_ENCODING));
            httpMethod.setRequestHeader("If-Match", oldConfig.getEtag());

            performRestRequest(httpMethod, 200);

            DistributionConfigHandler handler = (new CloudFrontXmlResponsesSaxParser())
View Full Code Here

                    .a("xmlns", XML_NAMESPACE)
                    .e("CallerReference").t(callerReference).up()
                    .e("Comment").t(comment);

            httpMethod.setEntity(new StringEntity(
                    builder.asString(null),
                    ContentType.create("text/xml", Constants.DEFAULT_ENCODING)));
            HttpResponse response = performRestRequest(httpMethod, 201);

            OriginAccessIdentityHandler handler =
                    (new CloudFrontXmlResponsesSaxParser(this.jets3tProperties))
View Full Code Here

                    "CloudFrontOriginAccessIdentityConfig")
                    .a("xmlns", XML_NAMESPACE)
                    .e("CallerReference").t(oldConfig.getCallerReference()).up()
                    .e("Comment").t(comment);
            httpMethod.setEntity(new StringEntity(
                    builder.asString(null),
                    ContentType.create("text/xml", Constants.DEFAULT_ENCODING)));
            httpMethod.setHeader("If-Match", oldConfig.getEtag());
            HttpResponse response = performRestRequest(httpMethod, 200);

            OriginAccessIdentityConfigHandler handler =
View Full Code Here

        FactoryConfigurationError, TransformerException
    {
        XMLBuilder builder = XMLBuilder.create("CreateBucketConfiguration")
            .attr("xmlns", Constants.XML_NAMESPACE)
            .elem("LocationConstraint").text(location);
        return builder.asString();
    }

}
View Full Code Here

            builder
                .elem("TopicConfiguration")
                    .elem("Topic").text(topicConfig.topic).up()
                    .elem("Event").text(topicConfig.event);
        }
        return builder.asString();
    }

    public class TopicConfig {
        protected String topic;
        protected String event;
View Full Code Here

            .elem("IndexDocument").elem("Suffix").text(this.getIndexDocumentSuffix())
            .up().up();
        if (this.getErrorDocumentKey() != null && this.getErrorDocumentKey().length() > 0) {
            builder.elem("ErrorDocument").elem("Key").text(this.getErrorDocumentKey());
        }
        return builder.asString();
    }

}
View Full Code Here

            builder.elem("MainPageSuffix").text(this.getIndexDocumentSuffix());
        }
        if (this.getErrorDocumentKey() != null && this.getErrorDocumentKey().length() > 0) {
            builder.elem("NotFoundPage").text(this.getErrorDocumentKey());
        }
        return builder.asString();
    }

}
View Full Code Here

      for (Entry<String, String> entry : options.getProperties().entrySet()) {
         rootBuilder.e("Property").a("key", entry.getKey()).t(entry.getValue());
      }
      Properties outputProperties = new Properties();
      outputProperties.put(javax.xml.transform.OutputKeys.OMIT_XML_DECLARATION, "yes");
      return rootBuilder.asString(outputProperties);
   }

   protected XMLBuilder buildRoot(String name) throws ParserConfigurationException, FactoryConfigurationError {
      XMLBuilder rootBuilder = XMLBuilder.create("CatalogItem").a("name", name).a("xmlns", ns).a("xmlns:xsi",
               "http://www.w3.org/2001/XMLSchema-instance").a("xsi:schemaLocation", ns + " " + schema);
View Full Code Here

      XMLBuilder rootBuilder = buildRoot(name, options);
      addElementsUnderRoot(rootBuilder, source, options, isSourceDelete);
      Properties outputProperties = new Properties();
      outputProperties.put(javax.xml.transform.OutputKeys.OMIT_XML_DECLARATION, "yes");
      try {
         return rootBuilder.asString(outputProperties);
      } catch (Exception e) {
         throw Throwables.propagate(e);
      }
   }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.