예제 #1
0
 private void addOpenHomeElement(
     String method, String action, Map<String, String> headerMap, String bodyText) {
   Element ht = super.setChildElement("http-tunnel", "http://icontrol.com/http-tunnel/v1");
   Element reqE = ht.addElement("request");
   reqE.addAttribute("method", method.toUpperCase());
   reqE.addAttribute("action", action);
   // headers
   if (headerMap != null) {
     for (Iterator<String> i = headerMap.keySet().iterator(); i.hasNext(); ) {
       String name = i.next();
       String text = headerMap.get(name);
       Element header = reqE.addElement("header");
       header.addAttribute("name", name);
       header.add(docFactory.createText(text));
     }
   }
   // body
   Element body = reqE.addElement("body");
   body.addAttribute("name", "body");
   if (bodyText != null) body.add(docFactory.createText(bodyText));
 }
 public Text createText(String text) {
   return proxy.createText(text);
 }