Examples of encodeAsString()


Examples of org.apache.commons.codec.binary.Base64.encodeAsString()

    public void sendInput(byte[] buf) throws IOException {
        logger.debug("Sending WinRM Send Input request for command {} in shell {}", commandId, shellId);

        final Element bodyContent = DocumentHelper.createElement(QName.get("Send", Namespaces.NS_WIN_SHELL));
        final Base64 base64 = new Base64();
        bodyContent.addElement(QName.get("Stream", Namespaces.NS_WIN_SHELL)).addAttribute("Name", "stdin").addAttribute("CommandId", commandId).addText(base64.encodeAsString(buf));
        final Document requestDocument = getRequestDocument(Action.WS_SEND, ResourceURI.RESOURCE_URI_CMD, null, bodyContent);
        sendRequest(requestDocument, SoapAction.SEND);

        logger.debug("Sent WinRM Send Input request for command {} in shell {}", commandId, shellId);
    }
View Full Code Here

Examples of org.geotools.xml.Encoder.encodeAsString()

  @Override 
  protected GeoPipeFlow process(GeoPipeFlow flow) {
    Encoder encoder = new Encoder(new KMLConfiguration());
    encoder.setIndenting(true);
    try {
      setProperty(flow, encoder.encodeAsString(flow.getGeometry(), KML.Geometry));
    } catch (IOException e) {
      setProperty(flow, e.getMessage());
    }   
    return flow;
 
View Full Code Here

Examples of org.geotools.xml.Encoder.encodeAsString()

        Encoder enc = new Encoder(configuration);
        enc.setEncoding(Charset.forName("UTF-8"));
        enc.setIndenting(true);
        enc.setIndentSize(1);

        String encodedTransactionResponse = enc.encodeAsString(tr,
                "1.0.0".equals(getStrategy().getVersion()) ? org.geotools.wfs.v1_0.WFS.WFS_TransactionResponse :
                    WFS.TransactionResponse);
        System.err.println(encodedTransactionResponse);
        return encodedTransactionResponse;
    }
View Full Code Here

Examples of org.geotools.xml.Encoder.encodeAsString()

        Encoder encoder = new Encoder(filterConfig);
        // do not write the xml declaration
        encoder.setOmitXMLDeclaration(true);
        encoder.setEncoding(Charset.forName("UTF-8"));

        String encoded = encoder.encodeAsString(filter, encName);

        encoded = encoded.replaceAll("\n", "");
        return encoded;
    }
View Full Code Here

Examples of org.geotools.xml.Encoder.encodeAsString()

        Encoder encoder = new Encoder(new OWSConfiguration());
        encoder.setIndenting(true);
        encoder.setIndentSize(2);
       
        // used to throw an exception here
        encoder.encodeAsString(report, OWS.ExceptionReport);
    }
}
View Full Code Here

Examples of org.geotools.xml.Encoder.encodeAsString()

        encoder.setIndenting(true);
        encoder.setNamespaceAware(true);
        encoder.getNamespaces().declarePrefix("ows", OWS.NAMESPACE);
        encoder.getNamespaces().declarePrefix("ogc", OGC.NAMESPACE);
        encoder.getNamespaces().declarePrefix("gml", GML.NAMESPACE);
        String encoded = encoder.encodeAsString(caps, CSW.Capabilities);
        // System.out.println(encoded);
       
        CapabilitiesType reParsed = (CapabilitiesType) parser.parse(new StringReader(encoded));
        assertTrue(EMFUtils.emfEquals(caps, reParsed));
    }
View Full Code Here

Examples of org.geotools.xml.Encoder.encodeAsString()

        encoder.setIndenting(true);
        encoder.setNamespaceAware(true);
        encoder.getNamespaces().declarePrefix("ows", OWS.NAMESPACE);
        encoder.getNamespaces().declarePrefix("ogc", OGC.NAMESPACE);
        encoder.getNamespaces().declarePrefix("gml", GML.NAMESPACE);
        String encoded = encoder.encodeAsString(caps, CSW.Capabilities);
       
        // System.out.println(encoded);

        // prepare xmlunit
        Map<String, String> namespaces = new HashMap<String, String>();
View Full Code Here

Examples of org.geotools.xml.Encoder.encodeAsString()

                filter.append("(");
            }
            try {
                Encoder e = new Encoder(new FESConfiguration());
                e.setOmitXMLDeclaration(true);
                filter.append(e.encodeAsString(q.getFilter(), FES.Filter));
            }
            catch (Exception e) {
                throw new RuntimeException("Unable to encode filter " + f, 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.