maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbout...@apache.org
Subject svn commit: r1037298 - /maven/archetype/trunk/archetype-testing/archetype-repository/src/main/java/org/apache/maven/archetype/repository/RepositoryServlet.java
Date Sat, 20 Nov 2010 18:57:25 GMT
Author: hboutemy
Date: Sat Nov 20 18:57:24 2010
New Revision: 1037298

URL: http://svn.apache.org/viewvc?rev=1037298&view=rev
Log:
removed superfluous code

Modified:
    maven/archetype/trunk/archetype-testing/archetype-repository/src/main/java/org/apache/maven/archetype/repository/RepositoryServlet.java

Modified: maven/archetype/trunk/archetype-testing/archetype-repository/src/main/java/org/apache/maven/archetype/repository/RepositoryServlet.java
URL: http://svn.apache.org/viewvc/maven/archetype/trunk/archetype-testing/archetype-repository/src/main/java/org/apache/maven/archetype/repository/RepositoryServlet.java?rev=1037298&r1=1037297&r2=1037298&view=diff
==============================================================================
--- maven/archetype/trunk/archetype-testing/archetype-repository/src/main/java/org/apache/maven/archetype/repository/RepositoryServlet.java
(original)
+++ maven/archetype/trunk/archetype-testing/archetype-repository/src/main/java/org/apache/maven/archetype/repository/RepositoryServlet.java
Sat Nov 20 18:57:24 2010
@@ -22,15 +22,14 @@ import java.io.FileNotFoundException;
 import java.io.FileWriter;
 import java.io.IOException;
 import java.io.InputStream;
-import java.io.PrintWriter;
 import java.io.StringWriter;
-import javax.servlet.ServletConfig;
 import javax.servlet.ServletException;
 import javax.servlet.ServletRequest;
 import javax.servlet.ServletResponse;
 import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+
 import org.mortbay.util.IO;
 import org.mortbay.util.StringUtil;
 
@@ -41,27 +40,6 @@ import org.mortbay.util.StringUtil;
 public class RepositoryServlet
     extends HttpServlet
 {
-    private ServletConfig config;
-
-    /*
-     * (non-Javadoc)
-     * @see javax.servlet.Servlet#init(javax.servlet.ServletConfig)
-     */
-    public void init( ServletConfig config )
-        throws ServletException
-    {
-        this.config = config;
-    }
-
-    /*
-     * (non-Javadoc)
-     * @see javax.servlet.Servlet#getServletConfig()
-     */
-    public ServletConfig getServletConfig()
-    {
-        return config;
-    }
-
     /*
      * (non-Javadoc)
      * @see javax.servlet.Servlet#service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
@@ -72,9 +50,6 @@ public class RepositoryServlet
         HttpServletRequest request = (HttpServletRequest) req;
         HttpServletResponse response = (HttpServletResponse) res;
 
-        response.setHeader( "Date", null );
-        response.setHeader( "Server", null );
-
         log( "Requested file = " + request.getRequestURI() );
         String filePath =
             System.getProperty( "org.apache.maven.archetype.reporitory.directory" ).trim()
+ "/"
@@ -111,7 +86,7 @@ public class RepositoryServlet
             catch ( IOException iOException )
             {
                 response.setStatus( HttpServletResponse.SC_INTERNAL_SERVER_ERROR );
-                log( "Can not send file", iOException );
+                log( "Cannot send file", iOException );
             }
         }
         else if ( "PUT".equalsIgnoreCase( method ) )
@@ -140,7 +115,7 @@ public class RepositoryServlet
             {
 
                 response.setStatus( HttpServletResponse.SC_INTERNAL_SERVER_ERROR );
-                log( "Can not send file", iOException );
+                log( "Cannot send file", iOException );
             }
         }
         else
@@ -178,53 +153,4 @@ public class RepositoryServlet
             }
         }
     }
-
-    /*
-     * (non-Javadoc)
-     * @see javax.servlet.Servlet#getServletInfo()
-     */
-    public String getServletInfo()
-    {
-        return "Repository Servlet";
-    }
-
-    /*
-     * (non-Javadoc)
-     * @see javax.servlet.Servlet#destroy()
-     */
-    public void destroy()
-    {
-    }
-
-    /**
-     * Processes requests for both HTTP <code>GET</code> and <code>POST</code>
methods.
-     * 
-     * @param request servlet request
-     * @param response servlet response
-     */
-    protected void processRequest( HttpServletRequest request, HttpServletResponse response
)
-        throws ServletException, IOException
-    {
-        response.setContentType( "text/html;charset=UTF-8" );
-        PrintWriter out = response.getWriter();
-        try
-        {
-            /*
-             * TODO output your page here out.println("<html>"); out.println("<head>");
-             * out.println("<title>Servlet RepositoryServlet</title>"); out.println("</head>");
out.println("<body>");
-             * out.println("<h1>Servlet RepositoryServlet at " + request.getContextPath
() + "</h1>");
-             * out.println("</body>"); out.println("</html>");
-             */
-        }
-        finally
-        {
-            out.close();
-        }
-    }
-
-    public String getServletName()
-    {
-        return "Repository Servlet";
-    }
-
 }
\ No newline at end of file



Mime
View raw message