Commit 2f0f4c25 by 袁伟铭

1.0.0

parent 1514dafc
...@@ -113,15 +113,16 @@ public class UploadUtils { ...@@ -113,15 +113,16 @@ public class UploadUtils {
public static String tempToFormal(String tempPath) { public static String tempToFormal(String tempPath) {
Path path = Paths.get(tempPath); Path path = Paths.get(tempPath);
File formal = new File(tempPath.replace("/temp", "")); String formalPath = tempPath.replace("/temp", "");
File formalFile = new File(formalPath);
try { try {
FileUtils.writeByteArrayToFile(formal, Files.readAllBytes(path)); FileUtils.writeByteArrayToFile(formalFile, Files.readAllBytes(path));
Files.delete(path); Files.delete(path);
} catch (IOException e) { } catch (IOException e) {
log.error("文件转存失败:{}", e.getMessage()); log.error("文件转存失败:{}", e.getMessage());
throw new BusinessException("文件转存失败"); throw new BusinessException("文件转存失败");
} }
return tempPath.replace("/temp", ""); return formalPath;
} }
/*public static void main(String[] args) { /*public static void main(String[] args) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment