| 1 | 
    
            
    
     | 
    
           | 
  
            
  
    | 2 | 
    
            
    
     | 
    
           | 
  
            
  
    | 3 | 
    
            
    
     | 
    
           | 
  
            
  
    | 4 | 
    
            
    
     | 
    
           | 
  
            
  
    | 5 | 
    
            
    
     | 
    
           | 
  
            
  
    | 6 | 
    
            
    
     | 
    
           | 
  
            
  
    | 7 | 
    
            
    
     | 
    
           | 
  
            
  
    | 8 | 
    
            
    
     | 
    
           | 
  
            
  
    | 9 | 
    
            
    
     | 
    
           | 
  
            
  
    | 10 | 
    
            
    
     | 
    
           | 
  
            
  
    | 11 | 
    
            
    
     | 
    
           | 
  
            
  
    | 12 | 
    
            
    
     | 
    
           | 
  
            
  
    | 13 | 
    
            
    
     | 
    
           | 
  
            
  
    | 14 | 
    
            
    
     | 
    
           | 
  
            
  
    | 15 | 
    
            
    
     | 
    
           | 
  
            
  
    | 16 | 
    
            
    
     | 
    
           | 
  
            
  
    | 17 | 
    
            
    
     | 
    
           | 
  
            
  
    | 18 | 
    
            
    
     | 
    
           | 
  
            
  
    | 19 | 
    
            
    
     | 
    
           | 
  
            
  
    | 20 | 
    
            
    
     | 
    
           | 
  
            
  
    | 21 | 
    
            
    
     | 
    
           | 
  
            
  
    | 22 | 
    
            
    
     | 
    
           | 
  
            
  
    | 23 | 
    
            
    
     | 
    
           | 
  
            
  
    | 24 | 
    
            
    
     | 
    
           | 
  
            
  
    | 25 | 
    
            
    
     | 
    
           | 
  
            
  
    | 26 | 
    
            
    
     | 
    
           | 
  
            
  
    | 27 | 
    
            
    
     | 
    
           | 
  
            
  
    | 28 | 
    
            
    
     | 
    
           | 
  
            
  
    | 29 | 
    
            
    
     | 
    
           | 
  
            
  
    | 30 | 
    
            
    
     | 
    
           | 
  
            
  
    | 31 | 
    
            
    
     | 
    
           | 
  
            
  
    | 32 | 
    
            
    
     | 
    
      package net.sourceforge.pebble.web.controller;     | 
  
            
  
    | 33 | 
    
            
    
     | 
    
           | 
  
            
  
    | 34 | 
    
            
    
     | 
    
      import net.sourceforge.pebble.webservice.BloggerAPIHandler;     | 
  
            
  
    | 35 | 
    
            
    
     | 
    
      import net.sourceforge.pebble.webservice.MetaWeblogAPIHandler;     | 
  
            
  
    | 36 | 
    
            
    
     | 
    
      import net.sourceforge.pebble.webservice.PebbleAPIHandler;     | 
  
            
  
    | 37 | 
    
            
    
     | 
    
      import net.sourceforge.pebble.webservice.SearchAPIHandler;     | 
  
            
  
    | 38 | 
    
            
    
     | 
    
      import org.apache.xmlrpc.XmlRpcServer;     | 
  
            
  
    | 39 | 
    
            
    
     | 
    
      import org.springframework.context.ApplicationContext;     | 
  
            
  
    | 40 | 
    
            
    
     | 
    
      import org.springframework.web.context.support.WebApplicationContextUtils;     | 
  
            
  
    | 41 | 
    
            
    
     | 
    
           | 
  
            
  
    | 42 | 
    
            
    
     | 
    
      import javax.servlet.ServletException;     | 
  
            
  
    | 43 | 
    
            
    
     | 
    
      import javax.servlet.http.HttpServlet;     | 
  
            
  
    | 44 | 
    
            
    
     | 
    
      import javax.servlet.http.HttpServletRequest;     | 
  
            
  
    | 45 | 
    
            
    
     | 
    
      import javax.servlet.http.HttpServletResponse;     | 
  
            
  
    | 46 | 
    
            
    
     | 
    
      import java.io.IOException;     | 
  
            
  
    | 47 | 
    
            
    
     | 
    
      import java.io.OutputStream;     | 
  
            
  
    | 48 | 
    
            
    
     | 
    
           | 
  
            
  
    | 49 | 
    
            
    
     | 
    
           | 
  
            
  
    | 50 | 
    
            
    
     | 
    
           | 
  
            
  
    | 51 | 
    
            
    
     | 
    
           | 
  
            
  
    | 52 | 
    
            
    
     | 
    
      @author     | 
  
            
  
    | 53 | 
    
            
    
     | 
    
           | 
  
               
        | 
             
         | 
        
       
        | 
       
           
           
            | 0% | 
           Uncovered Elements: 25 (25) | 
           Complexity: 5 | 
           Complexity Density: 0,24 | 
                        
            
        | 
    
  
  
    | 54 | 
    
            
    
     | 
    
      public class XmlRpcController extends HttpServlet {     | 
  
            
  
    | 55 | 
    
            
    
     | 
    
           | 
  
            
  
    | 56 | 
    
            
    
     | 
    
             | 
  
            
  
    | 57 | 
    
            
    
     | 
    
           | 
  
            
  
    | 58 | 
    
            
    
     | 
    
           | 
  
               
        | 
             
         | 
        
       
        | 
       
           
           
            |  -  | 
           Uncovered Elements: 0 (0) | 
           Complexity: 1 | 
           Complexity Density: - | 
                        
            
        | 
    
  
  
    | 59 | 
    
           0
    
     | 
    
         public void init() {...     | 
  
            
  
    | 60 | 
    
            
    
     | 
    
        }     | 
  
            
  
    | 61 | 
    
            
    
     | 
    
           | 
  
            
  
    | 62 | 
    
            
    
     | 
    
             | 
  
            
  
    | 63 | 
    
            
    
     | 
    
           | 
  
            
  
    | 64 | 
    
            
    
     | 
    
           | 
  
            
  
    | 65 | 
    
            
    
     | 
    
      @param     | 
  
            
  
    | 66 | 
    
            
    
     | 
    
      @param     | 
  
            
  
    | 67 | 
    
            
    
     | 
    
           | 
  
               
        | 
             
         | 
        
       
        | 
       
           
           
            | 0% | 
           Uncovered Elements: 19 (19) | 
           Complexity: 2 | 
           Complexity Density: 0,11 | 
                        
            
        | 
    
  
  
    | 68 | 
    
           0
    
     | 
    
         protected void processRequest(HttpServletRequest request,...     | 
  
            
  
    | 69 | 
    
            
    
     | 
    
                                      HttpServletResponse response)     | 
  
            
  
    | 70 | 
    
            
    
     | 
    
            throws ServletException, IOException {     | 
  
            
  
    | 71 | 
    
            
    
     | 
    
           | 
  
            
  
    | 72 | 
    
           0
    
     | 
    
          try {     | 
  
            
  
    | 73 | 
    
           0
    
     | 
    
            XmlRpcServer xmlrpc = new XmlRpcServer();     | 
  
            
  
    | 74 | 
    
           0
    
     | 
    
            ApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(getServletContext());     | 
  
            
  
    | 75 | 
    
            
    
     | 
    
           | 
  
            
  
    | 76 | 
    
           0
    
     | 
    
            BloggerAPIHandler bloggerApi = (BloggerAPIHandler)ctx.getBean("bloggerApiHandler");     | 
  
            
  
    | 77 | 
    
           0
    
     | 
    
            xmlrpc.addHandler("blogger", bloggerApi);     | 
  
            
  
    | 78 | 
    
            
    
     | 
    
           | 
  
            
  
    | 79 | 
    
           0
    
     | 
    
            MetaWeblogAPIHandler metaweblogApi = (MetaWeblogAPIHandler)ctx.getBean("metaweblogApiHandler");     | 
  
            
  
    | 80 | 
    
           0
    
     | 
    
            xmlrpc.addHandler("metaWeblog", metaweblogApi);     | 
  
            
  
    | 81 | 
    
            
    
     | 
    
           | 
  
            
  
    | 82 | 
    
           0
    
     | 
    
            PebbleAPIHandler pebbleApi = (PebbleAPIHandler)ctx.getBean("pebbleApiHandler");     | 
  
            
  
    | 83 | 
    
           0
    
     | 
    
            xmlrpc.addHandler("pebble", pebbleApi);     | 
  
            
  
    | 84 | 
    
            
    
     | 
    
           | 
  
            
  
    | 85 | 
    
           0
    
     | 
    
            SearchAPIHandler searchApi = (SearchAPIHandler)ctx.getBean("searchApiHandler");     | 
  
            
  
    | 86 | 
    
           0
    
     | 
    
            xmlrpc.addHandler("search", searchApi);     | 
  
            
  
    | 87 | 
    
            
    
     | 
    
           | 
  
            
  
    | 88 | 
    
           0
    
     | 
    
            byte[] result = xmlrpc.execute(request.getInputStream());     | 
  
            
  
    | 89 | 
    
           0
    
     | 
    
            response.setContentType("text/xml; charset=UTF-8");     | 
  
            
  
    | 90 | 
    
           0
    
     | 
    
            response.setContentLength(result.length);     | 
  
            
  
    | 91 | 
    
           0
    
     | 
    
            OutputStream out = response.getOutputStream();     | 
  
            
  
    | 92 | 
    
           0
    
     | 
    
            out.write(result);     | 
  
            
  
    | 93 | 
    
           0
    
     | 
    
            out.flush();     | 
  
            
  
    | 94 | 
    
            
    
     | 
    
          } catch (Exception e) {     | 
  
            
  
    | 95 | 
    
           0
    
     | 
    
            e.printStackTrace();     | 
  
            
  
    | 96 | 
    
           0
    
     | 
    
            throw new ServletException(e);     | 
  
            
  
    | 97 | 
    
            
    
     | 
    
          }     | 
  
            
  
    | 98 | 
    
            
    
     | 
    
        }     | 
  
            
  
    | 99 | 
    
            
    
     | 
    
           | 
  
            
  
    | 100 | 
    
            
    
     | 
    
             | 
  
            
  
    | 101 | 
    
            
    
     | 
    
           | 
  
            
  
    | 102 | 
    
            
    
     | 
    
           | 
  
            
  
    | 103 | 
    
            
    
     | 
    
      @param     | 
  
            
  
    | 104 | 
    
            
    
     | 
    
      @param     | 
  
            
  
    | 105 | 
    
            
    
     | 
    
           | 
  
               
        | 
             
         | 
        
       
        | 
       
           
           
            | 0% | 
           Uncovered Elements: 1 (1) | 
           Complexity: 1 | 
           Complexity Density: 1 | 
                        
            
        | 
    
  
  
    | 106 | 
    
           0
    
     | 
    
         protected void doGet(HttpServletRequest req, HttpServletResponse res)...     | 
  
            
  
    | 107 | 
    
            
    
     | 
    
            throws ServletException, IOException {     | 
  
            
  
    | 108 | 
    
            
    
     | 
    
           | 
  
            
  
    | 109 | 
    
           0
    
     | 
    
          processRequest(req, res);     | 
  
            
  
    | 110 | 
    
            
    
     | 
    
        }     | 
  
            
  
    | 111 | 
    
            
    
     | 
    
           | 
  
            
  
    | 112 | 
    
            
    
     | 
    
             | 
  
            
  
    | 113 | 
    
            
    
     | 
    
           | 
  
            
  
    | 114 | 
    
            
    
     | 
    
           | 
  
            
  
    | 115 | 
    
            
    
     | 
    
      @param     | 
  
            
  
    | 116 | 
    
            
    
     | 
    
      @param     | 
  
            
  
    | 117 | 
    
            
    
     | 
    
           | 
  
               
        | 
             
         | 
        
       
        | 
       
           
           
            | 0% | 
           Uncovered Elements: 1 (1) | 
           Complexity: 1 | 
           Complexity Density: 1 | 
                        
            
        | 
    
  
  
    | 118 | 
    
           0
    
     | 
    
         protected void doPost(HttpServletRequest req, HttpServletResponse res)...     | 
  
            
  
    | 119 | 
    
            
    
     | 
    
            throws ServletException, IOException {     | 
  
            
  
    | 120 | 
    
            
    
     | 
    
           | 
  
            
  
    | 121 | 
    
           0
    
     | 
    
          processRequest(req, res);     | 
  
            
  
    | 122 | 
    
            
    
     | 
    
        }     | 
  
            
  
    | 123 | 
    
            
    
     | 
    
           | 
  
            
  
    | 124 | 
    
            
    
     | 
    
      }     |