You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jspwiki.apache.org by me...@apache.org on 2009/03/02 21:32:40 UTC

svn commit: r749430 - in /incubator/jspwiki/trunk: ./ src/WebContent/WEB-INF/classes/plugin/ src/java/org/apache/wiki/ src/java/org/apache/wiki/attachment/ src/java/org/apache/wiki/dav/ tests/java/org/apache/wiki/ tests/java/org/apache/wiki/dav/

Author: metskem
Date: Mon Mar  2 20:32:39 2009
New Revision: 749430

URL: http://svn.apache.org/viewvc?rev=749430&view=rev
Log:
3.0.0-svn-76 JSPWIKI-513 Removed DAV support

Removed:
    incubator/jspwiki/trunk/src/java/org/apache/wiki/dav/
    incubator/jspwiki/trunk/tests/java/org/apache/wiki/dav/
Modified:
    incubator/jspwiki/trunk/ChangeLog
    incubator/jspwiki/trunk/src/WebContent/WEB-INF/classes/plugin/PluginResources.properties
    incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java
    incubator/jspwiki/trunk/src/java/org/apache/wiki/attachment/AttachmentServlet.java
    incubator/jspwiki/trunk/tests/java/org/apache/wiki/AllTests.java

Modified: incubator/jspwiki/trunk/ChangeLog
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/ChangeLog?rev=749430&r1=749429&r2=749430&view=diff
==============================================================================
--- incubator/jspwiki/trunk/ChangeLog (original)
+++ incubator/jspwiki/trunk/ChangeLog Mon Mar  2 20:32:39 2009
@@ -1,3 +1,9 @@
+2009-03-02  Harry Metske <me...@apache.org>
+
+        * 3.0.0-svn-76
+        
+        * JSPWIKI-513 Remove DAV support
+        
 2009-02-27  Harry Metske <me...@apache.org>
 
         * 3.0.0-svn-75

Modified: incubator/jspwiki/trunk/src/WebContent/WEB-INF/classes/plugin/PluginResources.properties
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/WebContent/WEB-INF/classes/plugin/PluginResources.properties?rev=749430&r1=749429&r2=749430&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/WebContent/WEB-INF/classes/plugin/PluginResources.properties (original)
+++ incubator/jspwiki/trunk/src/WebContent/WEB-INF/classes/plugin/PluginResources.properties Mon Mar  2 20:32:39 2009
@@ -86,4 +86,4 @@
 plugin.interwikilinks.noconstruct=Unable to construct InterwikiLinks plugin output (see logs)
 
 # UndefinedPagesPlugin
-plugin.undefined.parm.invalid=parameter is not valid for the UndefinedPagesPlugin :
\ No newline at end of file
+plugin.undefined.parm.invalid=parameter is not valid for the UndefinedPagesPlugin
\ No newline at end of file

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java?rev=749430&r1=749429&r2=749430&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/Release.java Mon Mar  2 20:32:39 2009
@@ -77,7 +77,7 @@
      *  <p>
      *  If the build identifier is empty, it is not added.
      */
-    public static final String     BUILD         = "75";
+    public static final String     BUILD         = "76";
     
     /**
      *  This is the generic version string you should use

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/attachment/AttachmentServlet.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/attachment/AttachmentServlet.java?rev=749430&r1=749429&r2=749430&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/attachment/AttachmentServlet.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/attachment/AttachmentServlet.java Mon Mar  2 20:32:39 2009
@@ -47,12 +47,6 @@
 import org.apache.wiki.api.WikiPage;
 import org.apache.wiki.auth.AuthorizationManager;
 import org.apache.wiki.auth.permissions.PermissionFactory;
-import org.apache.wiki.dav.AttachmentDavProvider;
-import org.apache.wiki.dav.DavPath;
-import org.apache.wiki.dav.DavProvider;
-import org.apache.wiki.dav.WebdavServlet;
-import org.apache.wiki.dav.methods.DavMethod;
-import org.apache.wiki.dav.methods.PropFindMethod;
 import org.apache.wiki.filters.RedirectException;
 import org.apache.wiki.i18n.InternationalizationManager;
 import org.apache.wiki.log.Logger;
@@ -79,7 +73,6 @@
  *  @since 1.9.45.
  */
 public class AttachmentServlet
-    extends WebdavServlet
 {
     private static final int BUFFER_SIZE = 8192;
 
@@ -96,8 +89,6 @@
 
     private String m_tmpDir;
 
-    private DavProvider m_attachmentProvider;
-
     /**
      *  The maximum size that an attachment can be.
      */
@@ -125,12 +116,9 @@
     public void init( ServletConfig config )
         throws ServletException
     {
-        super.init( config );
-
         m_engine         = WikiEngine.getInstance( config );
         Properties props = m_engine.getWikiProperties();
-
-        m_attachmentProvider = new AttachmentDavProvider( m_engine );
+        
         m_tmpDir         = m_engine.getWorkDir()+File.separator+"attach-tmp";
 
         m_maxSize        = TextUtil.getIntegerProperty( props,
@@ -191,25 +179,6 @@
     }
 
     /**
-     *  Implements the PROPFIND method.
-     *  
-     *  @param req The servlet request
-     *  @param res The servlet response
-     *  @throws IOException If input/output fails
-     *  @throws ServletException If the servlet has issues
-     */
-    public void doPropFind( HttpServletRequest req, HttpServletResponse res )
-        throws IOException, ServletException
-    {
-        DavMethod dm = new PropFindMethod( m_attachmentProvider );
-
-        String p = new String(req.getPathInfo().getBytes("ISO-8859-1"), "UTF-8");
-
-        DavPath path = new DavPath( p );
-
-        dm.execute( req, res, path );
-    }
-    /**
      *  Implements the OPTIONS method.
      *  
      *  @param req The servlet request
@@ -218,8 +187,7 @@
 
     protected void doOptions( HttpServletRequest req, HttpServletResponse res )
     {
-        res.setHeader( "DAV", "1" ); // We support only Class 1
-        res.setHeader( "Allow", "GET, PUT, POST, OPTIONS, PROPFIND, PROPPATCH, MOVE, COPY, DELETE");
+        res.setHeader( "Allow", "GET, PUT, POST, OPTIONS");
         res.setStatus( HttpServletResponse.SC_OK );
     }
 
@@ -497,60 +465,6 @@
         }
     }
 
-    /**
-     *  {@inheritDoc}
-     */
-    public void doPut( HttpServletRequest req, HttpServletResponse res )
-        throws IOException, ServletException
-    {
-        String errorPage = m_engine.getURL( WikiContext.ERROR, "", null, false ); // If something bad happened, Upload should be able to take care of most stuff
-
-        String p = new String(req.getPathInfo().getBytes("ISO-8859-1"), "UTF-8");
-        DavPath path = new DavPath( p );
-
-        try
-        {
-            InputStream data = req.getInputStream();
-
-            WikiContext context;
-            try
-            {
-                context = m_engine.getWikiContextFactory().newContext( req, res, WikiContext.UPLOAD );
-            }
-            catch( WikiException e )
-            {
-                throw new ServletException( e );
-            }
-
-            String wikipage = path.get( 0 );
-
-            errorPage = context.getURL( WikiContext.UPLOAD,
-                                        wikipage );
-
-            String changeNote = null; // FIXME: Does not quite work
-
-            boolean created = executeUpload( context, data,
-                                             path.getName(),
-                                             errorPage, wikipage,
-                                             changeNote,
-                                             req.getContentLength() );
-
-            if( created )
-                res.sendError( HttpServletResponse.SC_CREATED );
-            else
-                res.sendError( HttpServletResponse.SC_OK );
-        }
-        catch( ProviderException e )
-        {
-            res.sendError( HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
-                           e.getMessage() );
-        }
-        catch( RedirectException e )
-        {
-            res.sendError( HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
-                           e.getMessage() );
-        }
-    }
 
     /**
      *  Validates the next page to be on the same server as this webapp.

Modified: incubator/jspwiki/trunk/tests/java/org/apache/wiki/AllTests.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/AllTests.java?rev=749430&r1=749429&r2=749430&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/AllTests.java (original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/AllTests.java Mon Mar  2 20:32:39 2009
@@ -52,7 +52,6 @@
         suite.addTest( org.apache.wiki.content.AllTests.suite() );
         suite.addTest( org.apache.wiki.attachment.AllTests.suite() );
         suite.addTest( org.apache.wiki.auth.AllTests.suite() );
-        suite.addTest( org.apache.wiki.dav.AllTests.suite() );
         suite.addTest( org.apache.wiki.diff.AllTests.suite() );
         suite.addTest( org.apache.wiki.filters.AllTests.suite() );
         suite.addTest( org.apache.wiki.htmltowiki.AllTests.suite() );