You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by re...@apache.org on 2001/05/10 19:01:03 UTC

cvs commit: jakarta-slide/src/webdav/server/org/apache/slide/webdav/method PutMethod.java

remm        01/05/10 10:01:02

  Modified:    src/webdav/server/org/apache/slide/webdav/method
                        PutMethod.java
  Log:
  - Get the content type from the request headers submitted by the client,
    instead of doing a lookup in the MIME table of the webserver.
    Patch submitted by Dirk Verbeeck <dirk.verbeeck at the-ecorp.com>
  
  Revision  Changes    Path
  1.11      +14 -8     jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PutMethod.java
  
  Index: PutMethod.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PutMethod.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- PutMethod.java	2001/04/26 17:01:59	1.10
  +++ PutMethod.java	2001/05/10 17:00:58	1.11
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PutMethod.java,v 1.10 2001/04/26 17:01:59 remm Exp $
  - * $Revision: 1.10 $
  - * $Date: 2001/04/26 17:01:59 $
  + * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/PutMethod.java,v 1.11 2001/05/10 17:00:58 remm Exp $
  + * $Revision: 1.11 $
  + * $Date: 2001/05/10 17:00:58 $
    *
    * ====================================================================
    *
  @@ -201,9 +201,12 @@
                           new NodeProperty("getcontentlanguage", "en", true);
                       revisionDescriptor.setProperty(property);
                       
  -                    String contentType =
  -                        servlet.getServletContext().getMimeType(resourcePath);
  +                    String contentType = req.getContentType();
                       if (contentType == null) {
  +                        contentType = servlet.getServletContext()
  +                            .getMimeType(resourcePath);
  +                    }
  +                    if (contentType == null) {
                           contentType = "text/plain";
                       }
                       property = new NodeProperty("getcontenttype", contentType,
  @@ -254,8 +257,11 @@
                   revisionDescriptor.setProperty(property);
                   
                   // Get content type
  -                String contentType =
  -                    servlet.getServletContext().getMimeType(resourcePath);
  +                String contentType = req.getContentType();
  +                if (contentType == null) {
  +                    contentType = servlet.getServletContext()
  +                        .getMimeType(resourcePath);
  +                }
                   if (contentType == null) {
                       contentType = "text/plain";
                   }
  @@ -360,7 +366,7 @@
               
               String status = new String("HTTP/1.1 " + WebdavStatus.SC_CREATED
                                          + " " + WebdavStatus.getStatusText
  -                                       (WebdavStatus.SC_CREATED));;
  +                                       (WebdavStatus.SC_CREATED));
               
               
           } catch (RevisionAlreadyExistException e) {