@Override public String getRealPath(String path) { return b.request.getRealPath(path); }
@SuppressWarnings("deprecation") public String getRealPath(String s) { return delegate.getRealPath(s); }
@SuppressWarnings("deprecation") @Override public String getRealPath(String path) { return getRequest().getRealPath(path); }
@SuppressWarnings("deprecation") @Override public String getRealPath(String path) { return getRequest().getRealPath(path); }
response.setContentType("application/vnd.ms-excel;charset=UTF-8"); response.setHeader("content-disposition", "attachment;filename=" + new String(fileName.getBytes("GBK"), "ISO-8859-1") + ".xls"); File file = new File(request.getRealPath("/") + File.separator + "templates" + File.separator + "temp" + File.separator + templateName + ".xls"); FileInputStream inputStream = new FileInputStream(file);
file = new File(request.getRealPath("/")+sysfile.getFilePath()); if (file != null && file.exists() && file.isFile()) { long filelength = file.length();
try { String relPath = PropertiesUtil.getValue("markdownPath"); String dirPath = request.getRealPath("/");
@RequestMapping(value = "generateXMLFile",method = RequestMethod.POST) @ResponseBody public Result generateXMLFile(String xmlContent, String xmlFile, HttpServletRequest request) { String xmlPath = request.getRealPath("/").replaceAll("webapp", "resources") + File.separator + "query" + File.separator + xmlFile; String rn = "\r\n";
@RequestMapping(value="/delete",method = RequestMethod.POST) @ResponseBody public Result delete(String id,HttpServletRequest request){ SysFile sysFile=uploaderService.get(SysFile.class,id); String dirPath=request.getRealPath("/"); FileUtil.delFile(dirPath+uploaderPath+File.separator+sysFile.getSavedName()); uploaderService.delete(sysFile); return new Result(); }
/** * 生成资源文件,并返回文件路径 给开发者看的 */ @RequestMapping(value = "/processdef/generate/{type}/{pdId}", method = RequestMethod.POST) @ResponseBody public Result generateResource(@PathVariable("type") String type, @PathVariable("pdId") String pdId, HttpServletRequest request) { try { String dirPath = request.getRealPath("/"); ProcessDefinition processDefinition = repositoryService.getProcessDefinition(pdId); String resourceName = ""; if (type.equals("image")) { resourceName = processDefinition.getDiagramResourceName(); } else if (type.equals("xml")) { resourceName = processDefinition.getResourceName(); } InputStream resourceAsStream = repositoryService.getResourceAsStream(processDefinition.getDeploymentId(), resourceName); String realPath = dirPath + File.separator + DIR_PATH + File.separator + resourceName; realPath=realPath.replaceAll("\\\\", "/"); File file = new File(realPath); if (file.exists()) { file.delete(); } FileUtil.copyInputStreamToFile(resourceAsStream, file); String realName = (DIR_PATH + File.separator + resourceName).replaceAll("\\\\", "/"); return new Result(true, realName, "成功生成png"); } catch (Exception e) { LOGGER.error("生成资源文件异常,pdId={}", pdId, e); return new Result(false); } }
modelId, HttpServletRequest request) { try { String dirPath = request.getRealPath("/"); Model model = repositoryService.getModel(modelId); if (type.equals("xml")) {
String dirPath = request.getRealPath("/"); for (int i = 0; i < files.length; i++) { MultipartFile file = files[i];
@VerifyCSRFToken @RequestMapping(method = RequestMethod.POST, value = "/save") @ResponseBody private Result saveUser(User user, HttpServletRequest request) { if (StrUtil.isEmpty(user.getId())) { //设置初始密码 user.setPassword(EncryptUtil.getPassword(initPassword,user.getLoginName())); String userId = userService.save(user).toString(); userRoleService.setRoleForRegisterUser(userId); //头像和用户管理 userService.updateUserAvatar(user, request.getRealPath("/")); } else { User oldUser=this.getUser(user.getId()); BeanUtils.copyProperties(user,oldUser,"password"); if(!oldUser.getLoginName().equals(user.getLoginName())){ oldUser.setPassword(EncryptUtil.getPassword(initPassword,user.getLoginName())); } oldUser.setUpdateDateTime(new Date()); userService.update(oldUser); } return new Result(true); }
public String getRealPath(String path) { if (copy != null) { return copy.getRealPath(path); } else { return path; } }
public String getRealPath(String path) { if(httpServletRequest != null) { return httpServletRequest.getRealPath(path); } return null; }
@RequestMapping(value = "/getImage/{imageId}") @ResponseBody public byte[] getImage(@PathVariable long imageId, HttpServletRequest request) { String rpath=request.getRealPath("/"); rpath=rpath+"/"+imageId; // whatever path you used for storing the file Path path = Paths.get(rpath); byte[] data = Files.readAllBytes(path); return bytes; }
public Result generateImage(@PathVariable("instanceId") String instanceId, HttpServletRequest request) { try { String dirPath = request.getRealPath("/"); ProcessInstance processInstance=runtimeService.createProcessInstanceQuery().processInstanceId(instanceId) .singleResult();
List<FileResult.PreviewConfig> previewConfigs=new ArrayList<>(); String dirPath = request.getRealPath("/"); String[] fileArr=new String[fileList.size()]; int index=0;
return new Result(false, "部署失败", "流程尚未定义或定义错误,不能生成有效的xml和png文件"); String basePath = request.getRealPath("/"); String fileName = modelData.getKey() + ".bpmn20.model.zip"; String zipFileName = DIR_PATH + File.separator + fileName;
public GenerateSetting getQuerySetting(String queryId, String className, HttpServletRequest request) throws ClassNotFoundException { GenerateSetting setting = new GenerateSetting(); String realPath = request.getRealPath("/"); if(StrUtil.isEmpty(realPath)){ System.out.println("realPath is null:请在开发环境中使用该功能");