imario      2004/12/29 11:47:34

  Modified:    vfs/src/java/org/apache/commons/vfs/provider
                        AbstractFileSystem.java
               vfs/src/java/org/apache/commons/vfs/impl
                        DefaultFileMonitor.java
  Log:
  use the thread-safe way to reread fileattributes
  
  Revision  Changes    Path
  1.34      +1 -1      
jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/AbstractFileSystem.java
  
  Index: AbstractFileSystem.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/AbstractFileSystem.java,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- AbstractFileSystem.java   8 Nov 2004 21:07:43 -0000       1.33
  +++ AbstractFileSystem.java   29 Dec 2004 19:47:34 -0000      1.34
  @@ -256,7 +256,7 @@
           return resolveFile(name, true);
       }
   
  -    public synchronized FileObject resolveFile(final FileName name, final 
boolean useCache) throws FileSystemException
  +    private synchronized FileObject resolveFile(final FileName name, final 
boolean useCache) throws FileSystemException
       {
           if (!rootName.getRootURI().equals(name.getRootURI()))
           {
  
  
  
  1.4       +5 -9      
jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/impl/DefaultFileMonitor.java
  
  Index: DefaultFileMonitor.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/impl/DefaultFileMonitor.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DefaultFileMonitor.java   12 Oct 2004 13:16:51 -0000      1.3
  +++ DefaultFileMonitor.java   29 Dec 2004 19:47:34 -0000      1.4
  @@ -329,11 +329,11 @@
        */
       private static class FileMonitorAgent
       {
  +        private final FileObject file;
  +        private final DefaultFileMonitor fm;
   
  -        private FileObject file;
           private boolean exists;
           private long timestamp;
  -        private DefaultFileMonitor fm;
           private Map children = null;
   
           private FileMonitorAgent(DefaultFileMonitor fm, FileObject file)
  @@ -392,15 +392,11 @@
           {
               try
               {
  -                // TODO: Activate *THE RIGHT WAY* as soon as VFS is 
completely thread-safe
  -                this.file = ((AbstractFileSystem) 
this.file.getFileSystem()).resolveFile(this.file.getName(), false);
  -                // FileSystemManager fsManager = 
this.file.getFileSystem().getFileSystemManager();
  -                // this.file = 
fsManager.resolveFile(this.file.getName().getPath());
  +                // this.file = ((AbstractFileSystem) 
this.file.getFileSystem()).resolveFile(this.file.getName(), false);
   
  -                // *THE RIGHT WAY*
                   // close the file - this will detach and reattach its 
resources (for this thread) on the
                   // next access
  -                // this.file.close();
  +                this.file.close();
               }
               catch (FileSystemException fse)
               {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to