cziegeler    2002/06/13 02:44:18

  Modified:    src/java/org/apache/cocoon/components/source/impl
                        FileSource.java
  Log:
  Changed file handling for output stream
  
  Revision  Changes    Path
  1.4       +11 -4     
xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/FileSource.java
  
  Index: FileSource.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/FileSource.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- FileSource.java   12 Jun 2002 12:28:16 -0000      1.3
  +++ FileSource.java   13 Jun 2002 09:44:18 -0000      1.4
  @@ -96,6 +96,13 @@
       }
   
       /**
  +     * Get the associated file
  +     */
  +    public File getFile() {
  +        return this.file;
  +    }
  +
  +    /**
        * A file outputStream that will rename the temp file to the destination file 
upon close()
        * and discard the temp file upon cancel().
        */
  @@ -116,11 +123,11 @@
   
               try {
                   // Delete destination file
  -                if (this.source.file.exists()) {
  -                    this.source.file.delete();
  +                if (this.source.getFile().exists()) {
  +                    this.source.getFile().delete();
                   }
                   // Rename temp file to destination file
  -                tmpFile.renameTo(this.source.file);
  +                tmpFile.renameTo(this.getFile().file);
   
               } finally {
                   // Ensure temp file is deleted, ie lock is released.
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     [EMAIL PROTECTED]
To unsubscribe, e-mail:          [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to