I'm using Spring MVC Structure in my project. My project Structure is as follow:
project
|
|
|Java Resources
| |
| src
WebContent
| |
| |
resources
|
|
form
|
Notification.pdf
I want to get the Absolute path of Notification.pdf when I call the Controller. I also tried the following code:
File file = new File("Notification.pdf");
String path = file.getAbsolutePath();
System.out.println("path: "+path);
Output: C:\Users\JohnPC\Desktop\Notification.pdf
Output I want: D:\workspace\project\WebContent\resources\form\Notification.pdf