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/02/02 07:28:05 UTC

cvs commit: jakarta-slide/src/stores/slidestore/reference FileContentStore.java

remm        01/02/01 22:28:05

  Modified:    src/stores/slidestore/reference FileContentStore.java
  Log:
  - When creating revision content, RevisionAlreadyExistException was
    abusively caught and rethrown as a ServiceAccessException, which was
    incorrect and caused the WebDAV servlet to report an internal server error
    (status 500). Now the exception is simply rethrown (and the WebDAV servlet
    should report a conflict).
    Thanks to Michael Smith <ms...@xn.com.au> for the patch.
  
  Revision  Changes    Path
  1.4       +11 -7     jakarta-slide/src/stores/slidestore/reference/FileContentStore.java
  
  Index: FileContentStore.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/stores/slidestore/reference/FileContentStore.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- FileContentStore.java	2001/01/20 20:08:29	1.3
  +++ FileContentStore.java	2001/02/02 06:28:05	1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-slide/src/stores/slidestore/reference/FileContentStore.java,v 1.3 2001/01/20 20:08:29 remm Exp $
  - * $Revision: 1.3 $
  - * $Date: 2001/01/20 20:08:29 $
  + * $Header: /home/cvs/jakarta-slide/src/stores/slidestore/reference/FileContentStore.java,v 1.4 2001/02/02 06:28:05 remm Exp $
  + * $Revision: 1.4 $
  + * $Date: 2001/02/02 06:28:05 $
    *
    * ====================================================================
    *
  @@ -76,7 +76,7 @@
    * Filesystem implementation of ContentStore.
    *
    * @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
  - * @version $Revision: 1.3 $
  + * @version $Revision: 1.4 $
    */
   public class FileContentStore extends AbstractSimpleService
       implements ContentStore {
  @@ -215,7 +215,8 @@
           NodeRevisionContent result = null;
           String revisionUri = null;
           if (version)
  -            revisionUri = uri.toString() + "_" + revisionDescriptor.getRevisionNumber();
  +            revisionUri = uri.toString() + "_" 
  +                + revisionDescriptor.getRevisionNumber();
           else
               revisionUri = uri.toString();
           try {
  @@ -227,8 +228,9 @@
               result.setContent(reader);
               result.setContent(is);
   	} catch (FileNotFoundException e) {
  -            throw new RevisionNotFoundException(uri.toString(),
  -                                                revisionDescriptor.getRevisionNumber());
  +            throw new RevisionNotFoundException
  +                (uri.toString(),
  +                 revisionDescriptor.getRevisionNumber());
           } catch (IOException e) {
               e.printStackTrace();
               throw new ServiceAccessException(this, e.getMessage());
  @@ -309,6 +311,8 @@
               
           } catch (IOException e) {
               throw new ServiceAccessException(this, e.getMessage());
  +        } catch(RevisionAlreadyExistException e) {
  +            throw e; // we do NOT want this caught by next clause.
           } catch (Exception e) {
               e.printStackTrace();
               throw new ServiceAccessException(this, e.getMessage());