commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mario Ivankovits <ma...@ops.co.at>
Subject Re: [VFS] VFS.getManager().getFilesCache() - exists() vs findFiles()
Date Sat, 04 Jun 2005 07:04:28 GMT
Philippe Poulard wrote:
> xmldbRaweb2004:xyl://user:pwd@www.foo.com/path/to/file.xml
> ^^^^^^^^^^^^^^
>    this is not the xmldb scheme, as recommended by XML:DB
I didnt mean to rename the provider, but to provide a mechanism where 
one can tie a set of FileSystemOptions to a specific provider.
However, there is also another way to solve this. You can pass the 
FileSystemOptions to the resolveFile method.

FileObject fo = FileSystemManager.resolveFile(String name, 
FileSystemOptions fileSystemOptions)
Any subsequent call to "fo" (e.g. FileObject.resolveFile) will be able 
to access these options.

>> What if we create a new method "FileObject.createFile(Map attributes)"?
>> That way there is no need to change the contract of the IMAGINARY 
>> file type and it makes clear that if you would like to create a new 
>> file with special attributes you have to call that method.
> in this case, because of the particularity of all this stuff, it will 
> be more suitable to override the getAttributes() method (or another, i 
> will look the code) to perform the operation without checking the file 
> type
The best is to find a clean solution. The http filesystem might also 
profit from it as it might be needet to send the content-type of a file 
to the sever.

The problem with the solution to allow IMAGINARY Files to have 
attributes is the setAttribute Method. Its passed down to
AbstractFileObject.doSetAttribute(final String atttrName, final Object 
value)
which might immediately access the filesystem. But with IMAGNIARY files 
there is no file where the filesystem can attach those attribute then.

So why is it that bad to have a "FileObject.createFile/Folder(Map 
attributes)" isnt it a clean entry point to create a File/Folder with 
specific attributes?
Afterwards one can use setAttribute/getAttribute to modify them (if 
possible)

Also its needet to separate the attributes into FileSystemAttributes and 
FileAttributes.
You might not see any difference when you use your active tags. But 
there are differences if you use VFS in your code.

*) You have to pass the FileSystemAttributes only to the first resolveFile.
*) With every different set of FileSystemAttributes VFS will create a 
new FileSystem. So if you access two clusters VFS internally maintains 
two filesytems.

xmldb:xyl://user:pwd@www.foo.com/path/to/file.xml with cluster=Raweb2004 
is different to
xmldb:xyl://user:pwd@www.foo.com/path/to/file.xml with cluster=Raweb1998


---
Mario


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


Mime
View raw message