Closed GoogleCodeExporter closed 9 years ago
This should already work like you want: you can pass a full path to the method,
not just the filename by itself. It already handles the separator issue by
creating a File internally and getting the filename from it. Perhaps changing
the parameter name to "fullName" to match getFileExtension would make this more
clear?
Original comment by cgdec...@gmail.com
on 6 Sep 2012 at 4:05
What method are you talking about? The javadocs only mention two methods that I
can see, neither of which would remove the path and return the file name
including extension: getNameWithoutExtension, and getFileExtension. From what
I can tell neither of these could be used.
It's a side issue, but yes, I was actually going to suggest you use consistent
parameter names. I didn't only because I figured it was too pedantic. :)
Original comment by glenview...@gmail.com
on 6 Sep 2012 at 4:19
Hm... I clearly just saw "getNameWithoutExtension" there for some reason. Need
more coffee. =)
Anyway, we had a similar proposal come up internally recently. My opinion is
that it doesn't really provide any value over "new File(fullName).getName()".
Original comment by cgdec...@gmail.com
on 6 Sep 2012 at 4:30
There is a getNameWithoutExtension(). Just not a getNameWithoutPath().
Perhaps sleep would be a better substitute for coffee :)
I forgot that File() already had such a facility and agree that it's
preferable--consider the request withdrawn.
Original comment by glenview...@gmail.com
on 6 Sep 2012 at 4:38
(Yes, I know that getNameWithoutExtension exists. =) I just misread and took
this as a request for it to support full paths in the argument, which it of
course already does.)
Original comment by cgdec...@gmail.com
on 6 Sep 2012 at 4:46
This issue has been migrated to GitHub.
It can be found at https://github.com/google/guava/issues/<id>
Original comment by cgdecker@google.com
on 1 Nov 2014 at 4:13
Original comment by cgdecker@google.com
on 3 Nov 2014 at 9:08
Original issue reported on code.google.com by
glenview...@gmail.com
on 6 Sep 2012 at 2:25