You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by fi...@cirquedigital.com on 2006/03/17 10:11:25 UTC

[VFS] handling of broken links

Hi,

I noticed something interesting in how VFS is handling symbolic
links that point to a non-existing file. They're mapped to
FileType.IMAGINARY and FileObject.exists() returns false.

You can make arguments that this is not that bad of a choice,
but it seems to be impossible to delete such a broken link
inside of VFS..

Anybody any ideas of how to resolve this ? I'm guessing that
it should either be a FileType.LINK or a regular FileType.FILE
and that exists() should return true, but that when accessing
the content an exception needs to be thrown.

Thanks in advance!
- Filip


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


Re: [VFS] handling of broken links

Posted by fi...@cirquedigital.com.
> Hi!
>> Anybody any ideas of how to resolve this ? I'm guessing that
>> it should either be a FileType.LINK or a regular FileType.FILE
>> and that exists() should return true, but that when accessing
>> the content an exception needs to be thrown.
>>
> Sometimes I think VFS still do a little bit too much on its own logic.
>
> What if we keep the current behaviour but access the filesystem layer
> even if the file is not existent? (From VFSs point of view).
> Hmmm ... or your FileType.LINK ... I am not sure.

I think the FileType.LINK is probably opening a can of worms..
Probably accessing FS anyways is not a bad idea (I'm guessing
that that is what File does as well).

>
> What FS do you use?

the link problem is just on a regular local filesystem (but in general
I'm using primarity local, ftp, and sftp).

Cheers!
- Filip


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


Re: [VFS] handling of broken links

Posted by Mario Ivankovits <ma...@ops.co.at>.
Hi!
> Anybody any ideas of how to resolve this ? I'm guessing that
> it should either be a FileType.LINK or a regular FileType.FILE
> and that exists() should return true, but that when accessing
> the content an exception needs to be thrown.
>   
Sometimes I think VFS still do a little bit too much on its own logic.

What if we keep the current behaviour but access the filesystem layer
even if the file is not existent? (From VFSs point of view).
Hmmm ... or your FileType.LINK ... I am not sure.

What FS do you use?

Ciao,
Mario


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