Trouble understanding the meaning of the API
Marcel Ammerlaan
marcel-snoracle-nio at dyskolus.com
Wed Feb 3 12:42:55 PST 2010
Hi,
I'm working with the Path API, currently implementing an HTTP
filesystem. I have some troubles
understanding what the intention of the API is regarding Paths:
If I create a Path like this: Path p = Paths.get("/usr/bin/xset") and I
do a getName() on it
I get a Path again. The only use of this returned path is, in my
opinion, the toString()
method. This can also be seen as p.getName().toUri() returns the full
URI to the original
file, so the Path code is remembering both the full URI and the
name-part of it.
What is the use-case where getName() actually makes sense, or rephrased, why
doesn't getPath() return a String ?
Regards,
Marcel Ammerlaan.
More information about the nio-discuss
mailing list