@@ -0,0 +1,2641 @@
+package com.justjournal.ctl;%0A%0Aimport com.justjournal.JustJournalBaseServlet;%0Aimport com.justjournal.User;%0Aimport org.apache.log4j.Category;%0A%0Aimport javax.servlet.http.HttpServletRequest;%0Aimport javax.servlet.http.HttpServletResponse;%0Aimport javax.servlet.http.HttpSession;%0A%0A/**%0A * An implementation of Really Simple Discovery (RSD).%0A * %3Cp/%3E%0A * A list of points that blogging clients can use to post entries by %22autodiscovery%22.%0A *%0A * @author Lucas Holt%0A * @version $Id: Rsd.java,v 1.1 2008/04/26 14:42:04 laffer1 Exp $%0A *          %3Cp/%3E%0A *          User: laffer1%0A *          Date: Apr 26, 2008%0A *          Time: 10:22:20 AM%0A */%0Apublic class Rsd extends JustJournalBaseServlet %7B%0A%0A    private static Category log = Category.getInstance(Rsd.class.getName());%0A    private static final String XML_HEADER =%0A            %22%3C?xml version=%5C%221.0%5C%22 encoding=%5C%22utf-8%5C%22?%3E%5Cn%22;%0A    private static final String RSD_HEADER =%0A            %22%3Crsd xmlns=%5C%22http://archipelago.phrasewise.com/rsd%5C%22 version=%5C%221.0%5C%22%3E%5Cn%22;%0A    private static final String RSD_FOOTER =%0A            %22%3C/rsd%3E%5Cn%22;%0A%0A    protected void execute(HttpServletRequest request, HttpServletResponse response, HttpSession session, StringBuffer sb) %7B%0A        try %7B%0A            response.setContentType(%22text/xml; charset=utf-8%22);%0A%0A            String blogID = request.getParameter(%22blogID%22);%0A            if (blogID == null %7C%7C blogID.length() %3C 2) %7B%0A                throw new IllegalArgumentException(%22Missing required parameter %5C%22blogID%5C%22%22);%0A            %7D%0A%0A            User user = new User(blogID);%0A%0A            sb.append(XML_HEADER);%0A            sb.append(RSD_HEADER);%0A            sb.append(%22%3Cservice%3E%5Cn%22);%0A            sb.append(%22%5Ct%3CengineName%3EJustJournal%3C/engineName%3E%5Cn%22);%0A            sb.append(%22%5Ct%3CengineLink%3Ehttp://www.justjournal.com%3C/engineLink%3E%5Cn%22);%0A            sb.append(%22%5Ct%3ChomePageLink%3Ehttp://www.justjournal.com/users/%22);%0A            sb.append(user.getUserName()); // yeah we already know this but it's for output and thus safer.%0A            sb.append(%22%3C/homePageLink%3E%5Cn%22);%0A            // APIS we support.%0A            sb.append(%22%5Ct%3Capis%3E%5Cn%22);%0A            sb.append(%22%5Ct%5Ct%3Capi name=%5C%22Blogger%5C%22 preferred=%5C%22true%5C%22 apiLink=%5C%22http://www.justjournal.com/xml-rpc%5C%22 blogID=%5C%22%22);%0A            sb.append(user.getUserName());%0A            sb.append(%22%5C%22 /%3E%5Cn%22);%0A            sb.append(%22%5Ct%3C/apis%3E%5Cn%22);%0A            sb.append(%22%3C/service%3E%5Cn%22);%0A            sb.append(RSD_FOOTER);%0A%0A        %7D catch (Exception e) %7B%0A            sb.delete(0, sb.length() - 1);%0A            sb.append(XML_HEADER);%0A            sb.append(RSD_HEADER);%0A            sb.append(RSD_FOOTER);%0A            response.setStatus(500);%0A        %7D%0A    %7D%0A%0A%7D%0A

Add RSD implementation