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 ju...@apache.org on 2002/04/05 07:45:10 UTC

cvs commit: jakarta-slide/src/webdav/server/org/apache/slide/webdav/method ReportMethod.java UncheckoutMethod.java VersionControlMethod.java

juergen     02/04/04 21:45:10

  Modified:    src/webdav/server/org/apache/slide/webdav/method
                        ReportMethod.java UncheckoutMethod.java
                        VersionControlMethod.java
  Log:
  Set response status before throwing an exception in method parseRequest().
  Use appropriate status code for each exception.
  (ralf)
  
  Revision  Changes    Path
  1.13      +13 -8     jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/ReportMethod.java
  
  Index: ReportMethod.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/ReportMethod.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- ReportMethod.java	3 Apr 2002 11:55:07 -0000	1.12
  +++ ReportMethod.java	5 Apr 2002 05:45:10 -0000	1.13
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/ReportMethod.java,v 1.12 2002/04/03 11:55:07 juergen Exp $
  - * $Revision: 1.12 $
  - * $Date: 2002/04/03 11:55:07 $
  + * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/ReportMethod.java,v 1.13 2002/04/05 05:45:10 juergen Exp $
  + * $Revision: 1.13 $
  + * $Date: 2002/04/05 05:45:10 $
    *
    * ====================================================================
    *
  @@ -153,7 +153,7 @@
   /**
    * An implementation of the DeltaV <code>REPORT</code> method.
    *
  - * @version $Revision: 1.12 $
  + * @version $Revision: 1.13 $
    *
    * @author <a href="mailto:ralf.stuckert@softwareag.com">Ralf Stuckert</a>
    */
  @@ -284,6 +284,7 @@
               Element element = content.getRootElement();
               
               if (element == null) {
  +                resp.setStatus(WebdavStatus.SC_BAD_REQUEST);
                   throw new WebdavException(WebdavStatus.SC_BAD_REQUEST);
               }
               
  @@ -304,17 +305,21 @@
                   parseLocateByHistoryRequest(element);
               }
               else{
  +                resp.setStatus(WebdavStatus.SC_BAD_REQUEST);
                   throw new WebdavException(WebdavStatus.SC_BAD_REQUEST);
               }
           }
  -        catch (IOException  e){
  -            throw new WebdavException(WebdavStatus.SC_BAD_REQUEST);
  -        }
           catch (SAXException  e){
  +            resp.setStatus(WebdavStatus.SC_BAD_REQUEST);
               throw new WebdavException(WebdavStatus.SC_BAD_REQUEST);
           }
  +        catch (IOException  e){
  +            resp.setStatus(WebdavStatus.SC_INTERNAL_SERVER_ERROR);
  +            throw new WebdavException(WebdavStatus.SC_INTERNAL_SERVER_ERROR);
  +        }
           catch (ParserConfigurationException  e){
  -            throw new WebdavException(WebdavStatus.SC_BAD_REQUEST);
  +            resp.setStatus(WebdavStatus.SC_INTERNAL_SERVER_ERROR);
  +            throw new WebdavException(WebdavStatus.SC_INTERNAL_SERVER_ERROR);
           }
           catch (WebdavException e) {
               e.printStackTrace();
  
  
  
  1.3       +10 -7     jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/UncheckoutMethod.java
  
  Index: UncheckoutMethod.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/UncheckoutMethod.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- UncheckoutMethod.java	28 Mar 2002 06:12:12 -0000	1.2
  +++ UncheckoutMethod.java	5 Apr 2002 05:45:10 -0000	1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/UncheckoutMethod.java,v 1.2 2002/03/28 06:12:12 jericho Exp $
  - * $Revision: 1.2 $
  - * $Date: 2002/03/28 06:12:12 $
  + * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/UncheckoutMethod.java,v 1.3 2002/04/05 05:45:10 juergen Exp $
  + * $Revision: 1.3 $
  + * $Date: 2002/04/05 05:45:10 $
    *
    * ====================================================================
    *
  @@ -128,14 +128,17 @@
           try{
               retrieveRequestContent();
           }
  -        catch (IOException  e){
  -            throw new WebdavException(WebdavStatus.SC_BAD_REQUEST);
  -        }
           catch (SAXException  e){
  +            resp.setStatus(WebdavStatus.SC_BAD_REQUEST);
               throw new WebdavException(WebdavStatus.SC_BAD_REQUEST);
           }
  +        catch (IOException  e){
  +            resp.setStatus(WebdavStatus.SC_INTERNAL_SERVER_ERROR);
  +            throw new WebdavException(WebdavStatus.SC_INTERNAL_SERVER_ERROR);
  +        }
           catch (ParserConfigurationException  e){
  -            throw new WebdavException(WebdavStatus.SC_BAD_REQUEST);
  +            resp.setStatus(WebdavStatus.SC_INTERNAL_SERVER_ERROR);
  +            throw new WebdavException(WebdavStatus.SC_INTERNAL_SERVER_ERROR);
           }
       }
   
  
  
  
  1.10      +10 -7     jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/VersionControlMethod.java
  
  Index: VersionControlMethod.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/VersionControlMethod.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- VersionControlMethod.java	28 Mar 2002 06:12:12 -0000	1.9
  +++ VersionControlMethod.java	5 Apr 2002 05:45:10 -0000	1.10
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/VersionControlMethod.java,v 1.9 2002/03/28 06:12:12 jericho Exp $
  - * $Revision: 1.9 $
  - * $Date: 2002/03/28 06:12:12 $
  + * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/VersionControlMethod.java,v 1.10 2002/04/05 05:45:10 juergen Exp $
  + * $Revision: 1.10 $
  + * $Date: 2002/04/05 05:45:10 $
    *
    * ====================================================================
    *
  @@ -137,14 +137,17 @@
           try{
               retrieveRequestContent();
           }
  -        catch (IOException  e){
  -            throw new WebdavException(WebdavStatus.SC_BAD_REQUEST);
  -        }
           catch (SAXException  e){
  +            resp.setStatus(WebdavStatus.SC_BAD_REQUEST);
               throw new WebdavException(WebdavStatus.SC_BAD_REQUEST);
           }
  +        catch (IOException  e){
  +            resp.setStatus(WebdavStatus.SC_INTERNAL_SERVER_ERROR);
  +            throw new WebdavException(WebdavStatus.SC_INTERNAL_SERVER_ERROR);
  +        }
           catch (ParserConfigurationException  e){
  -            throw new WebdavException(WebdavStatus.SC_BAD_REQUEST);
  +            resp.setStatus(WebdavStatus.SC_INTERNAL_SERVER_ERROR);
  +            throw new WebdavException(WebdavStatus.SC_INTERNAL_SERVER_ERROR);
           }
       }
   
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>