I think that the purpose of "user.dir"
property is the same as pwd command in Linux or GetCurrentDirectory in Windows. I think it is more clear this way because we clearly use pwd
when we want to get the (absolute) path of the current directory. In contrast, .
is a shorthand for the current dir when you are not interested to know it but, rather, just tell the system that we want to use the current path. It is reasonable to use the shorthand in this case. First means current path relative to the root
, second -- current path relative to the current path
.
The difference may be important when you communicate between processes. If you pass a path to another process in your system, it may have a different current dir and, thus, you better prefer the absolute path. On the other hand, if you pass a path to another system, then relative path may be preferred.