how to read a folder outside the context
My current application setup is this
/usr/AppServer/CDev/Sections.ear/sectionSite/all-listings
I would like to read a folder thats in another location on the same box.
/usr/DiffServer/sectionSite/small-site/sports-news
from my JSP I'm doing
<%
currDir= new File("/usr/DiffServer/sectionSite/small-site/sports-news");
for (File dirItem : currDir.listFiles()) {
out.print("items "+dirItem.getName());
}
%>
Ofcourse I get a null pointer. What am I doing wrong and if its possible how do I get the list of files under /sports-news folder?
|