| | |
| | | return uploadObjectVO; |
| | | } |
| | | |
| | | @Override |
| | | public boolean removeFile(String path) { |
| | | String systemDir=System.getProperty("user.dir"); |
| | | String filePath=systemDir+File.separator+path; |
| | | File dirFile=new File(filePath); |
| | | if(!dirFile.isFile()){ |
| | | throw new ApiException("非文件,不能删除"); |
| | | } |
| | | if(!dirFile.exists()){ |
| | | throw new ApiException("文件不存在"); |
| | | } |
| | | dirFile.delete(); |
| | | return true; |
| | | } |
| | | |
| | | public UploadObjectVO doUpload(MultipartFile file){ |
| | | String filename=file.getOriginalFilename(); |
| | | String subfix=filename.substring(filename.lastIndexOf(".")); |