Given the following verified working directory structure:
/Users/me/Projects/DSS_Server/target/universal/stage/
And a higher directory containing some data:
/Users/me/Projects/DSS_Server/data/
My question is this:
How is it possible for just the following Java code to be able to access and read data from the data directory given the above verified working directory?
File input = new File("./data/rasterData.dat");
FileInputStream fis = new FileInputStream(input);
To clarify, the data really does exist here:
/Users/me/Projects/DSS_Server/data/rasterData.dat
And it does not exist here:
/Users/me/Projects/DSS_Server/target/universal/stage/data/rasterData.dat
The observed behavior suggests (but does not prove) that there can be a path resolution happening behind-the-scenes when using a relative path.
Note: this example is not something I am deliberately trying to or wanting do, rather, this scenario came about in an accidental way and was not noticed for a while because the server data still loads as expected. i.e., it wasn't immediately obvious that anything was broken.