Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
-
Operating System: All
Platform: All
-
39399
Description
In JCommander we need to display VFS URLs at many places in the GUI. We have two
requirements: hide any password and display user friendly paths where possible.
By user friendly paths we mean not displaying the file:// schema for local files
and showing the path with the platform specific path separator.
So for instance the ftp://user:pass@host.org/ is displayed as
ftp://user@host.org. Also, under Windows, the file://c:/ URL is displayed as c:\
We have a partially working implementation for this feature request which
approaches things in reverse by using regular expression match and replace. This
however is not the preferred way.
I think that such a feature should be part of VFS itself. I would like to
propose two API changes:
1. add the getFriendlyName() to the FileName interface - this method should work
as specified above, except that the string should be internally built rather
than regular expression based
2. change the toString() implementation of FileObject and FileName implementers
in a way that by default no password to be displayed so that no passwords show
up accidentally in log files
Please let me know what do you think about this feature request. The JCommander
team would be glad to provide a patch with the implementation if we can agree on
how to change the interfaces.