Reputation: 1658
I put some *.xls files to src/main/resources/templates/clientdocs folder. and trying to
private static final String FILEIN_NAME = "templates/clientdocs/file1.xls";
....
FileInputStream file = new FileInputStream(FILEIN_NAME))
Also i tried
"classpath:templates/clientdocs/file1.xls"
But in both cases i get that file not found. What is correct path should be?
Upvotes: 1
Views: 712
Reputation: 16284
You can put your file in your resources, e.g src/main/resources/clientdocs/file1.xls
and then use a ClassPathResource
.
Resource xlsRes = new ClassPathResource("clientdocs/file1.xls");
InputStream xlsStream = xlsRes.getInputStream();
Upvotes: 3