Package org.xmlBlaster.util

Examples of org.xmlBlaster.util.EncodableData


         this.content.setLength(0);
         String sizeStr = atts.getValue("size"); // long
         String type = atts.getValue("type"); // byte[]
         String encoding = atts.getValue("encoding"); // base64
         this.contentUrl = atts.getValue("url"); // file:/tmp/demo.png
         this.contentData = new EncodableData(CONTENT_TAG, null, type, encoding);
         try {
            if (sizeStr != null) {
               long size = Long.valueOf(sizeStr).longValue();
               if (size > 0)
                  this.contentData.setSize(size);
View Full Code Here


      else if (this.link != null) {
         if (this.attachments != null && this.attachments.containsKey(this.link)) {
            Object obj = this.attachments.get(this.link);
            if (obj instanceof String) {
               if (this.contentData == null)
                  this.contentData = new EncodableData(CONTENT_TAG, null, Constants.TYPE_STRING, Constants.ENCODING_NONE);
               this.contentData.setValueRaw((String)obj);
               currentContent = this.contentData.getBlobValue();
            }
            else {
               currentContent = (byte[])obj;
View Full Code Here

      }
      if (this.pluginAttributes != null) {
         Iterator it = this.pluginAttributes.getClientPropertyMap().values().iterator();
         while (it.hasNext()) {
            Object obj = it.next();
            EncodableData cp = (EncodableData)obj;
            sb.append(cp.toXml(offset+" ", ClientProperty.ATTRIBUTE_TAG));
         }
      }
      sb.append(offset).append("</").append(rootTag).append(">");

      return sb.toString();
View Full Code Here

                  }
               }
            }

            if (doEncode) {
               EncodableData data = new EncodableData("content", null, Constants.TYPE_BLOB, Constants.ENCODING_BASE64);
               data.setValue(content);
               data.setSize(content.length);
               to.write(data.toXml(" ").getBytes());
            }
            else {
               EncodableData data = new EncodableData("content", null, null, null);
               //String charSet = "UTF-8"; // "ISO-8859-1", "US-ASCII"
               //data.setValue(new String(content, charSet), null);
               data.setValueRaw(new String(content));
               data.forceCdata(true);
               data.setSize(content.length);
               to.write(data.toXml(" ").getBytes());
            }
         }
         {
            //MsgUnitRaw msg = new MsgUnitRaw(key, content, qos);
            //msg.toXml(" ", to);
View Full Code Here

TOP

Related Classes of org.xmlBlaster.util.EncodableData

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.