I have a relative file for a file upload
private String myPath= "..server\\app\\src\\test\\resources";
that is checked into source control. Everyone will have the same file structure for their file including and after server. However, since developers might have their repositories n different directories, I can't hard code the entire file path. How can I get the fully qualified file path from the relative path?
Use
String absolutePath = new File(myPath).getAbsolutePath();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With