08-02-2023, 01:19 PM
How can I use the classpath to specify the location of a file that is within my Spring project?
This is what I have currently:
FileReader fr = new FileReader("C:\\Users\\Corey\\Desktop\\storedProcedures.sql");
This is hardcoded to my Desktop. What I would like is to be able to use the path to the file that is in my project.
FileReader fr = new FileReader("/src/main/resources/storedProcedures.sql");
Any suggestions?
This is what I have currently:
FileReader fr = new FileReader("C:\\Users\\Corey\\Desktop\\storedProcedures.sql");
This is hardcoded to my Desktop. What I would like is to be able to use the path to the file that is in my project.
FileReader fr = new FileReader("/src/main/resources/storedProcedures.sql");
Any suggestions?