| | |
| | | return false; |
| | | } |
| | | |
| | | // 存放在数据库中的文件,直接判定是否有值 |
| | | if (attachmentFse.getValue(CmnConst.FILE_CONTENT) != null) { |
| | | return true; |
| | | } |
| | | |
| | | //判断文件存放在服务器还是本地 |
| | | boolean needDownloadFromServerFlag = "1".equals(attachmentFse.getString(CmnConst.UPLOAD_SIGN)); |
| | | String dir = attachmentFse.getString(CmnConst.ATTACHMENT_URL); |
| | |
| | | if (saveInDb) { |
| | | File localFile = new File(Global.getSystemConfig("local.dir", "") + File.separator + attachmentFse.getString(CmnConst.ATTACHMENT_URL) + File.separator + fileName); |
| | | if (!localFile.exists()) { |
| | | localFile.getParentFile().mkdirs(); |
| | | Files.copy(is, localFile.toPath(), StandardCopyOption.REPLACE_EXISTING); |
| | | } |
| | | } |