How can I find the path of my files that I have uploaded
I am currently trying to return strings from text file through a restful web service. However I am unable to access the file path location when running the web project on a tomcat server.
The file is contained in
Project root
|_Java Resources
|_package
|_MyServiceClass.java
|_ resources
|_myText.txt
The service to be created is using javax and looks like
@GET
@Produces(MediaType.TEXT_HTML)
public String returnStriing() throws {
String inputFileName = "resources/myText.txt";
File file = new File(inputFileName);
}
The solution provided using relative path did not work for me. How do I find the path of the file?