java.io.FileNotFoundException: D:\Servers\apache-tomcat-7.0.27\webapps\acct\accesscarddata (Access i s denied)
===

i upload a file into server and read the file from server, when i open the folder in server i see the uploaded file but when i try to access the file to process it gives me the following exception : 

    java.io.FileNotFoundException: D:\Servers\apache-tomcat-7.0.27\webapps\acct\accesscarddata (Access is denied)

this is how i try to read the file : 

    @SuppressWarnings({ "rawtypes", "unchecked" })
    	protected void readFile(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
    		String fileName = "", employeeAttendanceFilePath = "";
    		String _uploadDir = getServletContext().getRealPath("/accesscarddata/");
    		HttpSession session = request.getSession(true);
    		if (session.getAttribute("accesscardDatafileNname") != null)
    			fileName = (String) session.getAttribute("accesscardDatafileNname");
    
    		employeeAttendanceFilePath = _uploadDir + "/" + fileName;
    		List sheetData = new ArrayList();
    		FileInputStream fis = null;
    		try {
    			fis = new FileInputStream(employeeAttendanceFilePath);
    			HSSFWorkbook workbook = new HSSFWorkbook(fis);
    			HSSFSheet sheet = workbook.getSheetAt(0);// gets the first sheet on workbook
    			Iterator rows = sheet.rowIterator();
    			while (rows.hasNext()) {
    				HSSFRow row = (HSSFRow) rows.next();
    				Iterator cells = row.cellIterator();
    				// count=count+1;
    				List data = new ArrayList();
    				while (cells.hasNext()) {
    					HSSFCell cell = (HSSFCell) cells.next();
    					data.add(cell);
    				}
    				sheetData.add(data);
    			}
    		} catch (IOException e) {
    			e.printStackTrace();
    		} finally {
    			if (fis != null) {
    				fis.close();
    			}
    		}
    		session.setAttribute("sheetData", sheetData);
    
    	}

and the following is the stack trace : 

    java.io.FileNotFoundException: D:\Servers\apache-tomcat-7.0.27\webapps\acct\accesscarddata (Access i
    s denied)
            at java.io.FileInputStream.open(Native Method)
            at java.io.FileInputStream.<init>(FileInputStream.java:120)
            at java.io.FileInputStream.<init>(FileInputStream.java:79)
            at com.slingmedia.notifier.servlet.LeaveReportServlet.readFile(LeaveReportServlet.java:236)
            at com.slingmedia.notifier.servlet.LeaveReportServlet.doPost(LeaveReportServlet.java:159)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j
    ava:305)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
            at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
            at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
            at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999
    )
            at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.jav
    a:565)
            at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1812)
            at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
            at java.lang.Thread.run(Thread.java:662)


it is the problem of access permission i suppose but don't know whether the same or some other problem,

kindly provide me necessary inputs to solve this issue.

thanks and regards




