Reputation: 5867
I am refering file path in two places in my program. In one place, i pass file path in FileInputStream and in another place i pass to Spring getResource() method.
If i give file path in FileInputStream like "file:/C:/myfile
" it is throwing error. I had to give C:\\myfile
.
But in getResource() method, if i give C:\\myfile
it is throwing error i had to give file:/C:/myfile
.
Why this difference? Can you please clarify?
Upvotes: 1
Views: 128
Reputation: 9697
FileInputStream
is taking a String
representing file path. getResource()
from Spring is taking URL string representation of the resource.
Those two are not the same.
Upvotes: 2