Hello,

I am not sure I understand what the actual difference is, but you are right, 
the URL should actually be useable. However there are a lot of inconsistencies 
and backward compatibilities to look out for (even File itself has different 
URL/URI methods and never defined how Windows drives are to be handled). So can 
you give us an example path and what it looks like in URL from VFS and from 
java.io, so we can check if there is something to tweak.

Gruss
Bernd
--
http://bernd.eckenfels.net
________________________________
Von: Xeno Amess <xenoam...@gmail.com>
Gesendet: Thursday, January 23, 2020 2:40:59 PM
An: Commons Developers List <dev@commons.apache.org>
Betreff: Re: Getting File of FileObject (was: some questions (/bug?) about 
commons-vfs2 make me confused.)

I put it in dev-list because I really donot know wether it be a bug or not.
If it be a but then I'm actually willing for help.
But it seems by design but not a bug here, so I apologize.
Still, some questions hold.

/**
 * Returns a URL representing this file.
 *
 * @return the URL for the file.
 * @throws FileSystemException if an error occurs.
 */
URL getURL() throws FileSystemException;
that is the comments on getURL()
And IMO that is quite confusing actually.
You see if we use the same URL class and return it in such a public
method, it be normally to think it fit Java's standard, and can use
.URI if the protocol should be able to.
But the truth is the standard we used in vfs is sometimes different than Java.
The word [Sometimes] here is very dangerous and might be a bug causer,
because it can pass most tests and make users feel "Oh, it just return
a normal URL, and it really works right."
So IMO at least we shall add some more warning about "not using this
returned URL's some functions,including to URL, they might be
dangerous" or "we use different standard about file:// than Java's
file://"

Besides, I wonder why we must use a same URL class in vfs, if we
cannot guarantee it works consistently to Java lib?
Is it a better thought to create a new VFSURL class for URL in vfs?

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

Reply via email to