Hi,
I am trying to read the content of html file present in my local D drive inside slingServlet For e.g I have a file present at D:\\Home\product\demo.html, this path is provided in an excel-sheet I am reading the path from excel-sheet and fetching the content of the file present at that location. But instead of giving full absolute path of file in excel, I want to give relative path of file like this Home\product\demo.html or product\demo.html. I don't want to mention any drive path, since only home\product\demo.html structure is fix drive can be anything. Please suggest if there is any way to skip the drive path in slingservlet.
Thanks in Advance !!
Solved! Go to Solution.
This question is not specific to AEM, but a general Java question.
The "File" abstraction of Java allows you to use platform-dependent paths, that means on Windows you can use "D:\Home\...", while on an Unix system you can use /Home/...; so you don't have care about it at all.
Jörg
Views
Replies
Total Likes
This question is not specific to AEM, but a general Java question.
The "File" abstraction of Java allows you to use platform-dependent paths, that means on Windows you can use "D:\Home\...", while on an Unix system you can use /Home/...; so you don't have care about it at all.
Jörg
Views
Replies
Total Likes
Hi,
You can try file pattern matching if helps
Finding Files (The Java™ Tutorials > Essential Classes > Basic I/O)