Examples of XmlWriter


Examples of com.amazonaws.services.s3.internal.XmlWriter

        /*
         * We can only send the CreateBucketConfiguration if we're *not*
         * creating a bucket in the US region.
         */
        if (region != null && !region.toUpperCase().equals(Region.US_Standard.toString())) {
            XmlWriter xml = new XmlWriter();
            xml.start("CreateBucketConfiguration", "xmlns", Constants.XML_NAMESPACE);
            xml.start("LocationConstraint").value(region).end();
            xml.end();

            httpRequest.setContent(new ByteArrayInputStream(xml.getBytes()));
        }

        client.execute(httpRequest, voidResponseHandler, errorResponseHandler);

        return new Bucket(bucketName);
View Full Code Here

Examples of com.amazonaws.util.XMLWriter

        request.setResourcePath(uriResourcePath);

       
            StringWriter stringWriter = new StringWriter();
            XMLWriter xmlWriter = new XMLWriter(stringWriter, "http://cloudfront.amazonaws.com/doc/2012-05-05/");

           
                    if (updateStreamingDistributionRequest != null) {
            StreamingDistributionConfig streamingDistributionConfigStreamingDistributionConfig = updateStreamingDistributionRequest.getStreamingDistributionConfig();
            if (streamingDistributionConfigStreamingDistributionConfig != null) {
                xmlWriter.startElement("StreamingDistributionConfig");
                if (streamingDistributionConfigStreamingDistributionConfig.getCallerReference() != null) {
                    xmlWriter.startElement("CallerReference").value(streamingDistributionConfigStreamingDistributionConfig.getCallerReference()).endElement();
                }
                if (streamingDistributionConfigStreamingDistributionConfig != null) {
                    S3Origin s3OriginS3Origin = streamingDistributionConfigStreamingDistributionConfig.getS3Origin();
                    if (s3OriginS3Origin != null) {
                        xmlWriter.startElement("S3Origin");
                        if (s3OriginS3Origin.getDomainName() != null) {
                            xmlWriter.startElement("DomainName").value(s3OriginS3Origin.getDomainName()).endElement();
                        }
                        if (s3OriginS3Origin.getOriginAccessIdentity() != null) {
                            xmlWriter.startElement("OriginAccessIdentity").value(s3OriginS3Origin.getOriginAccessIdentity()).endElement();
                        }
                        xmlWriter.endElement();
                    }
                }
                if (streamingDistributionConfigStreamingDistributionConfig != null) {
                    Aliases aliasesAliases = streamingDistributionConfigStreamingDistributionConfig.getAliases();
                    if (aliasesAliases != null) {
                        xmlWriter.startElement("Aliases");
                        if (aliasesAliases.getQuantity() != null) {
                            xmlWriter.startElement("Quantity").value(aliasesAliases.getQuantity()).endElement();
                        }

                        if (aliasesAliases != null) {
                            java.util.List<String> aliasesAliasesitemsList = aliasesAliases.getItems();
                            if (aliasesAliasesitemsList != null && aliasesAliasesitemsList.size() > 0) {
                                int aliasesAliasesitemsListIndex = 1;
                                xmlWriter.startElement("Items");
                                for (String aliasesAliasesitemsListValue : aliasesAliasesitemsList) {

                                xmlWriter.startElement("CNAME");
                                    xmlWriter.value(aliasesAliasesitemsListValue);
                                xmlWriter.endElement();


                                    aliasesAliasesitemsListIndex++;
                                }
                                xmlWriter.endElement();
                            }
                        }
                        xmlWriter.endElement();
                    }
                }
                if (streamingDistributionConfigStreamingDistributionConfig.getComment() != null) {
                    xmlWriter.startElement("Comment").value(streamingDistributionConfigStreamingDistributionConfig.getComment()).endElement();
                }
                if (streamingDistributionConfigStreamingDistributionConfig != null) {
                    LoggingConfig loggingConfigLogging = streamingDistributionConfigStreamingDistributionConfig.getLogging();
                    if (loggingConfigLogging != null) {
                        xmlWriter.startElement("Logging");
                        if (loggingConfigLogging.isEnabled() != null) {
                            xmlWriter.startElement("Enabled").value(loggingConfigLogging.isEnabled()).endElement();
                        }
                        if (loggingConfigLogging.getBucket() != null) {
                            xmlWriter.startElement("Bucket").value(loggingConfigLogging.getBucket()).endElement();
                        }
                        if (loggingConfigLogging.getPrefix() != null) {
                            xmlWriter.startElement("Prefix").value(loggingConfigLogging.getPrefix()).endElement();
                        }
                        xmlWriter.endElement();
                    }
                }
                if (streamingDistributionConfigStreamingDistributionConfig != null) {
                    TrustedSigners trustedSignersTrustedSigners = streamingDistributionConfigStreamingDistributionConfig.getTrustedSigners();
                    if (trustedSignersTrustedSigners != null) {
                        xmlWriter.startElement("TrustedSigners");
                        if (trustedSignersTrustedSigners.isEnabled() != null) {
                            xmlWriter.startElement("Enabled").value(trustedSignersTrustedSigners.isEnabled()).endElement();
                        }
                        if (trustedSignersTrustedSigners.getQuantity() != null) {
                            xmlWriter.startElement("Quantity").value(trustedSignersTrustedSigners.getQuantity()).endElement();
                        }

                        if (trustedSignersTrustedSigners != null) {
                            java.util.List<String> trustedSignersTrustedSignersitemsList = trustedSignersTrustedSigners.getItems();
                            if (trustedSignersTrustedSignersitemsList != null && trustedSignersTrustedSignersitemsList.size() > 0) {
                                int trustedSignersTrustedSignersitemsListIndex = 1;
                                xmlWriter.startElement("Items");
                                for (String trustedSignersTrustedSignersitemsListValue : trustedSignersTrustedSignersitemsList) {

                                xmlWriter.startElement("AwsAccountNumber");
                                    xmlWriter.value(trustedSignersTrustedSignersitemsListValue);
                                xmlWriter.endElement();


                                    trustedSignersTrustedSignersitemsListIndex++;
                                }
                                xmlWriter.endElement();
                            }
                        }
                        xmlWriter.endElement();
                    }
                }
                if (streamingDistributionConfigStreamingDistributionConfig.isEnabled() != null) {
                    xmlWriter.startElement("Enabled").value(streamingDistributionConfigStreamingDistributionConfig.isEnabled()).endElement();
                }
                xmlWriter.endElement();
            }
        }


            try {
View Full Code Here

Examples of com.bradmcevoy.http.XmlWriter

    public String generate( List<PropFindResponse> propFindResponses ) {
        ByteArrayOutputStream responseOutput = new ByteArrayOutputStream();
        Map<String, String> mapOfNamespaces = helper.findNameSpaces( propFindResponses );
        ByteArrayOutputStream generatedXml = new ByteArrayOutputStream();
        XmlWriter writer = new XmlWriter( generatedXml );
        writer.writeXMLHeader();
        writer.open(WebDavProtocol.NS_DAV.getPrefix() ,"multistatus" + helper.generateNamespaceDeclarations( mapOfNamespaces ) );
        writer.newLine();
        helper.appendResponses( writer, propFindResponses, mapOfNamespaces );
        writer.close(WebDavProtocol.NS_DAV.getPrefix(),"multistatus" );
        writer.flush();
//        log.debug( generatedXml.toString() );
        helper.write( generatedXml, responseOutput );
        try {
            return responseOutput.toString( "UTF-8" );
        } catch( UnsupportedEncodingException ex ) {
View Full Code Here

Examples of com.caucho.vfs.XmlWriter

    else
      comparator = new TimeComparator();

    comparator.setDescending(true);

    XmlWriter out = new XmlWriter(response.getWriter());

    out.setStrategy(XmlWriter.HTML);
    out.setIndenting(false);

    out.println(
      "<!DOCTYPE html  PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"  \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">");

    String contextPath = request.getContextPath();

    if (contextPath == null || contextPath.length() == 0)
      contextPath = "/";

    String title = L.l("Profiling Results for {0}", contextPath);

    out.startElement("html");

    out.startElement("head");
    out.writeElement("title", title);

    out.startElement("style");
    out.writeAttribute("type", "text/css");

    out.println(
      "h1 { background: #ccddff; margin : 0 -0.5em 0.25em -0.25em; padding: 0.25em 0.25em; }");
    out.println(
      "h2 { background: #ccddff; padding: 0.25em 0.5em; margin : 0.5em -0.5em; }");
    out.println("table { border-collapse : collapse; }");
    out.println("th { background : #c78ae6; border-left : 1px; border-right : 1px}");
    out.println("tr { border-bottom : 1px dotted; }");
    out.println(".number { text-align : right; }");
    out.println("table table tr { border-bottom : none; }");

    out.endElement("style");

    out.endElement("head");

    out.startElement("body");
    out.writeElement("h1", title);

    out.startElement("table");
    out.writeAttribute("border", 0);

    out.startElement("tr");

    out.writeLineElement("th", L.l("Name"));

    out.writeLineElement("th", L.l("Average Time"));
    out.writeLineElement("th", L.l("Min Time"));
    out.writeLineElement("th", L.l("Max Time"));
    out.writeLineElement("th", L.l("Total Time"));

    out.writeLineElement("th", L.l("Invocation Count"));

    out.endElement("tr");

    ProfilerPoint root = _profilerManager.getRoot();
   
    List<ProfilerPoint> children = root.getChildren();
    Collections.sort(children, comparator);
    for (ProfilerPoint child : children)
      display(child, comparator, out, 0);

    out.endElement("table");

    out.endElement("body");

    out.endElement("html");
  }
View Full Code Here

Examples of com.ctc.wstx.sw.XmlWriter

        /* Need to ensure that the configuration object is not shared
         * any more; otherwise later changes via factory could be
         * visible half-way through output...
         */
        WriterConfig cfg = mConfig.createNonShared();
        XmlWriter xw;

        boolean autoCloseOutput = requireAutoClose || mConfig.willAutoCloseOutput();

        if (w == null) {
            if (enc == null) {
View Full Code Here

Examples of com.dotcms.repackage.org.dom4j.io.XMLWriter

          portletPreferences.remove(prefsValidatorEl);
        }

        ByteArrayOutputStream baos = new ByteArrayOutputStream();

        XMLWriter writer = new XMLWriter(
          baos, OutputFormat.createCompactFormat());

        writer.write(portletPreferences);

        defaultPreferences = baos.toString();
      }

      portletModel.setDefaultPreferences(defaultPreferences);
View Full Code Here

Examples of com.google.gdata.util.common.xml.XmlWriter

      this.xmlBlob = xmlBlob;
      this.mixedContent = mixedContent;
      this.innerXmlStringWriter = new StringWriter();
      try {
        this.innerXml = new XmlWriter(innerXmlStringWriter);
       
        // The XmlWriter constructor doesn't actually throw an IOException, so
        // once that constructor is fixed we can remove this catch block.
      } catch (IOException impossible) {
        throw new AssertionError(impossible);
View Full Code Here

Examples of com.joshondesign.xml.XMLWriter

    }


    private void saveRecentFiles(List<File> recentFiles, File file) {
        try {
            XMLWriter out = new XMLWriter(file);
            out.start("files");
            for(File f : recentFiles) {
                out.start("file","filepath",f.getAbsolutePath());
                out.end();
            }
            out.end();
            out.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
View Full Code Here

Examples of com.mucommander.xml.XmlWriter

 
    private static class Writer {
      private XmlWriter writer = null;

      private Writer(OutputStream stream) throws IOException {
        this.writer = new XmlWriter(stream);
      }
View Full Code Here

Examples of com.sun.tahiti.compiler.XMLWriter

        MarshallerGenerator.write( citm, writer, controller );
        xsltEngine.endDocument();
*/
        // get DOM representation of the marshaller
        DOMBuilder builder = new DOMBuilder();
        XMLWriter writer = XMLWriter.fromContentHandler(builder);
        writer.handler.startDocument();
        MarshallerGenerator.write( symbolizer, citm, writer, controller );
        writer.handler.endDocument();
       
        // produce a source code fragment from DOM.
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.