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 ms...@apache.org on 2001/06/13 06:46:35 UTC

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

msmith      01/06/12 21:46:35

  Modified:    src/stores/slidestore/reference FileContentStore.java
  Log:
  Try to leave the repository in a more consistent state if an IOException
  occurs while writing the file to the filesystem. Set the content length
  to the correct value regardless of what happens. Neccesary because this
  store doesn't implement transactional capabilities.
  
  Revision  Changes    Path
  1.8       +6 -4      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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- FileContentStore.java	2001/03/19 16:49:37	1.7
  +++ FileContentStore.java	2001/06/13 04:46:35	1.8
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-slide/src/stores/slidestore/reference/FileContentStore.java,v 1.7 2001/03/19 16:49:37 juergen Exp $
  - * $Revision: 1.7 $
  - * $Date: 2001/03/19 16:49:37 $
  + * $Header: /home/cvs/jakarta-slide/src/stores/slidestore/reference/FileContentStore.java,v 1.8 2001/06/13 04:46:35 msmith Exp $
  + * $Revision: 1.8 $
  + * $Date: 2001/06/13 04:46:35 $
    *
    * ====================================================================
    *
  @@ -76,7 +76,7 @@
    * Filesystem implementation of ContentStore.
    *
    * @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
  - * @version $Revision: 1.7 $
  + * @version $Revision: 1.8 $
    */
   public class FileContentStore extends AbstractService
       implements ContentStore {
  @@ -314,6 +314,8 @@
                   
                   if (contentLength != -1) {
                       if (position != contentLength) {
  +			// set content length so that repository is consistent
  +			revisionDescriptor.setContentLength(position);
                           if (position < contentLength) {
                               // Not enough bytes read !!!
                               throw new IOException("Not enough bytes read");