[jboss-user] [Beginner's Corner] - Re: Give permission to write to a folder?

Chris Williams do-not-reply at jboss.com
Thu Jan 27 14:40:37 EST 2011


Chris Williams [http://community.jboss.org/people/brandx] created the discussion

"Re: Give permission to write to a folder?"

To view the discussion, visit: http://community.jboss.org/message/583723#583723

--------------------------------------------------------------
1) To be truthful, it's JBoss EWP 5.1 not the community edition (I didn't think that it might be a version specific issue, hence asking here. I do have a question out to our reseller as well). Win 7. Java 6 update 23.
2) I'm starting it on the command line.
3) JBoss is being run as myself (chris.williams). If I start it as an Administrator, then it's run as my Admin account.
4) There is no exception since java.io.File.delete() just returns a boolean rather than throwing an exception.
5) ->



                    String resFolder = getInitParameter("resources.folder");

                    if (request.getParameter("page_action") != null) {
                              if (request.getParameter("page_action").compareTo("delete") == 0) { 
                                        File f = new File(resFolder + request.getParameter("filename"));
                                        if (!f.delete()) {
                                                  ServletOutputStream out = response.getOutputStream();
                                                  out.print("Couldn't delete");
                                                  out.close();
                                                  return;
                                        }

                                        response.sendRedirect("Resources.html");
                                        return;
                              }
                    }

6) Yes, a standalone application is able to delete from the target folder, even while JBoss is still running. I also tried setting the scan folder for the servlet to C:\ and was able to delete a file there, just not a file from the target folder.
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/583723#583723]

Start a new discussion in Beginner's Corner at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2075]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110127/95d3a5a1/attachment.html 


More information about the jboss-user mailing list