final HttpServletResponse response, final boolean post) throws ServletException {
String command = request.getParameter("command");
String type = request.getParameter("type");
// 初始化时,如果startupPath文件夹不存在,则自动创建startupPath文件夹
if ("Init".equals(command)){
User user = UserUtils.getUser();
if (user!=null){
String startupPath = request.getParameter("startupPath");// 当前文件夹可指定为模块名
if (startupPath!=null){
String[] ss = startupPath.split(":");
if (ss.length==2){
String path = "/userfiles/"+user.getId()+"/"+ss[0]+ss[1];
String realPath = request.getSession().getServletContext().getRealPath(path);
FileUtils.createDirectory(realPath);
}
}
}
}
// 快捷上传,自动创建当前文件夹,并上传到该路径
else if ("QuickUpload".equals(command) && type!=null){
User user = UserUtils.getUser();
if (user!=null){
String currentFolder = request.getParameter("currentFolder");// 当前文件夹可指定为模块名
String path = "/userfiles/"+user.getId()+"/"+type+(currentFolder!=null?currentFolder:"");
String realPath = request.getSession().getServletContext().getRealPath(path);
FileUtils.createDirectory(realPath);
}
}
// System.out.println("------------------------");