Package org.platformlayer.rest

Examples of org.platformlayer.rest.Utf8StringByteSource


          if (debug != null) {
            debug.println("Data: " + sendData);
          }

          String sendDataString = (String) sendData;
          httpRequest.setRequestContent(new Utf8StringByteSource(sendDataString));
        } else {
          switch (sendDataFormat) {
          case XML:
            if (debug != null) {
              debug.println("Data: [XML Content]");
            }

            JaxbHelper jaxbHelper = JaxbHelper.get(sendData.getClass());
            String xml = jaxbHelper.marshal(sendData, false);
            httpRequest.setRequestContent(new Utf8StringByteSource(xml));
            // jaxbHelper.marshal(sendData, false, getOutputStream());
            break;
          case JSON:
            if (debug != null) {
              debug.println("Data: [JSON Content]");
            }

            JsonHelper jsonHelper = JsonHelper.build(sendData.getClass());
            String json = jsonHelper.marshal(sendData, false);
            httpRequest.setRequestContent(new Utf8StringByteSource(json));
            // jsonHelper.marshal(sendData, false, getOutputStream());
            break;
          default:
            throw new IllegalStateException();
          }
View Full Code Here

TOP

Related Classes of org.platformlayer.rest.Utf8StringByteSource

Copyright © 2018 www.massapicom. 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.