@RestController@RequestMapping("files")publicclassFileController{@PostMapping("upload")publicStringupload(/*MultipartFile file*/){//获取文件名称// String originalFilename = file.getOriginalFilename();Properties properties =newProperties();try{BufferedReader bufferedReader =newBufferedReader(newFileReader((System.getProperty("user.dir")+File.separator)+"user.properties"));
properties.load(bufferedReader);//获取key对应的values值String name = properties.getProperty("name");String age = properties.getProperty("age");return"name is: >>>>> "+ name +", age is : >>>>>> "+ age;}catch(Exception e){
e.printStackTrace();}return"success";}}