In many environments, the application user is not allowed to read files outside the deployment directory. This is mainly done for security - for example, if someone breaks into your application, he will not be able to read the password file.
And in professionally managed environments, developers often do not have voting rights in the directory in which the application will be hosted.
, , , , .., ( .war ) getRealPath (""), , .
, . , .