| | |
| | | for (MetaFileEntity mf : list) { |
| | | // 移动文件 |
| | | File file = new File(temp + File.separator + mf.getPath()); |
| | | File newFile = new File(root + File.separator + mf.getName()); |
| | | file.renameTo(newFile); |
| | | File newFile = new File(root + File.separator + mf.getGuid()); |
| | | |
| | | MetaFileEntity old = metaFileService.selectByGuid(mf.getGuid()); |
| | | String filePath = null; |
| | | if (null == old) { |
| | | filePath = newFile.getPath(); |
| | | file.renameTo(newFile); |
| | | } else { |
| | | filePath = old.getPath(); |
| | | file.delete(); |
| | | } |
| | | |
| | | // 元数据 |
| | | MetaEntity me = createMetaEntity(entity); |
| | |
| | | |
| | | // 元数据文件 |
| | | MetaFileEntity mef = createMetaFileEntity(mf, entity); |
| | | mef.setPath(FileHelper.getRelativePath(newFile.getPath())); |
| | | mef.setPath(FileHelper.getRelativePath(filePath)); |
| | | |
| | | rows = metaFileService.insert(mef); |
| | | if (rows > 0) { |