Hi VFS/Mario,

There's a problem with java.io.File.canWrite() when accessing a CIFS share on windows with access control lists enabled: it's plain wrong (it just checks the read only flag iso checking the access control list -- returning a value that has nothing to do whether the file is actually writable or not -- known issue on the bug parade, but seems to not going to be fixed any time soon).

Obviously this is not a problem of VFS, except that AbstractFileObject.createFolder() checks the canWrite flag before attempting to create a directory -- because of this directories
on certain filesystems simply cannot be created.

Do you have a probem with taking out the if (!isWriteable()) check and have the doCreateFolder throw the exception itself iso having vfs throw it ? There might be other areas where a similar
thing happens (haven't checked createFile and the likes).

It would solve a very big issue I'm having right now...

Thanks a lot,
- Filip

----------------- AbstractFileObject:
   public void createFolder() throws FileSystemException
   {
       synchronized (fs)
       {
           if (getType() == FileType.FOLDER)
           {
               // Already exists as correct type
               return;
           }
           if (getType() != FileType.IMAGINARY)
           {
throw new FileSystemException("vfs.provider/create-folder-mismatched-type.error", name);
           }
           if (!isWriteable())
           {
throw new FileSystemException("vfs.provider/create-folder-read-only.error", name);
           }

// Traverse up the heirarchy and make sure everything is a folder
           final FileObject parent = getParent();
           if (parent != null)
           {
               parent.createFolder();
           }

           try
           {
               // Create the folder
               doCreateFolder();

               // Update cached info
               handleCreate(FileType.FOLDER);
           }
           catch (final RuntimeException re)
           {
               throw re;
           }
           catch (final Exception exc)
           {
throw new FileSystemException("vfs.provider/create-folder.error", name, exc);
           }
       }
   }


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

Reply via email to