You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by im...@apache.org on 2004/12/29 17:14:15 UTC

cvs commit: jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider DefaultFileContent.java FileContentThreadData.java

imario      2004/12/29 08:14:15

  Modified:    vfs/src/java/org/apache/commons/vfs/provider
                        DefaultFileContent.java FileContentThreadData.java
  Log:
  release referrences
  
  Revision  Changes    Path
  1.25      +5 -7      jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/DefaultFileContent.java
  
  Index: DefaultFileContent.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/DefaultFileContent.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- DefaultFileContent.java	29 Dec 2004 08:24:55 -0000	1.24
  +++ DefaultFileContent.java	29 Dec 2004 16:14:15 -0000	1.25
  @@ -70,7 +70,7 @@
           FileContentThreadData data = (FileContentThreadData) this.threadData.get();
           if (data == null)
           {
  -            data = new FileContentThreadData(this);
  +            data = new FileContentThreadData();
               this.threadData.set(data);
           }
           return data;
  @@ -341,7 +341,7 @@
        */
       public void close() throws FileSystemException
       {
  -        // try
  +        try
           {
               // Close the input stream
               while (getThreadData().getInstrsSize() > 0)
  @@ -353,7 +353,7 @@
               // Close the output stream
               if (this.getThreadData().getOutstr() != null)
               {
  -                this.getThreadData().getOutstr().close();
  +                this.getThreadData().closeOutstr();
               }
   
               // Close the random access stream
  @@ -361,7 +361,7 @@
               {
                   try
                   {
  -                    this.getThreadData().getRastr().close();
  +                    this.getThreadData().closeRastr();
                   }
                   catch (IOException e)
                   {
  @@ -369,12 +369,10 @@
                   }
               }
           }
  -        /*
           finally
           {
  -            setState(STATE_CLOSED);
  +            threadData.set(null);
           }
  -        */
       }
   
       /**
  
  
  
  1.3       +15 -4     jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/FileContentThreadData.java
  
  Index: FileContentThreadData.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/FileContentThreadData.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FileContentThreadData.java	21 Dec 2004 21:57:18 -0000	1.2
  +++ FileContentThreadData.java	29 Dec 2004 16:14:15 -0000	1.3
  @@ -15,8 +15,10 @@
    */
   package org.apache.commons.vfs.provider;
   
  +import org.apache.commons.vfs.FileSystemException;
   import org.apache.commons.vfs.RandomAccessContent;
   
  +import java.io.IOException;
   import java.io.InputStream;
   import java.util.ArrayList;
   
  @@ -31,11 +33,8 @@
       private DefaultFileContent.FileContentOutputStream outstr;
       private RandomAccessContent rastr;
   
  -    private final DefaultFileContent defaultFileContent;
  -
  -    FileContentThreadData(DefaultFileContent defaultFileContent)
  +    FileContentThreadData()
       {
  -        this.defaultFileContent = defaultFileContent;
       }
   
       /*
  @@ -93,5 +92,17 @@
       public boolean hasStreams()
       {
           return instrs.size() > 0 || outstr != null || rastr != null;
  +    }
  +
  +    public void closeOutstr() throws FileSystemException
  +    {
  +        outstr.close();
  +        outstr = null;
  +    }
  +
  +    public void closeRastr() throws IOException
  +    {
  +        rastr.close();
  +        rastr = null;
       }
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org