我在web应用中是这样写的:
dirFile = new File(destPath);
bFile = dirFile.exists();
if (bFile == true) 
{
        ....

else 
{
        System.out.println("The folder do not exists");
        bFile = dirFile.mkdir();
        if (bFile == true)
          System.out.println("Create successfully!");
        else
          System.out.println("Disable to make the folder ,please check the disk is full or not.");
}其中destPath是一个绝对路径,我确定路径是存在的,理论上应该执行bFile== true的代码
在eclipse测试环境下打开tomcat启动这个web应用这端程序执行没问题,但是我发布后启动tomcat发现日志里面输出的是else的过程,日志的最后显示“拒绝访问”,测试和发布的机器是同一台机器,所以我感觉应该不太可能是没有访问权限的问题,请教大家帮忙看看!