| | |
| | | package com.lf.server.service.data; |
| | | |
| | | import com.lf.server.entity.data.MetaFileEntity; |
| | | import com.lf.server.entity.sys.UserEntity; |
| | | import com.lf.server.helper.FileHelper; |
| | | import com.lf.server.helper.PathHelper; |
| | | import com.lf.server.helper.StringHelper; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 自理实体集合 |
| | | */ |
| | | public void dealEntities(List<MetaFileEntity> list) { |
| | | for (MetaFileEntity entity : list) { |
| | | entity.setPath(FileHelper.getRelativePath(entity.getPath())); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 删除文件 |
| | | * @param list 实体集合 |
| | | * @return |
| | | */ |
| | | public Integer deleteFiles(List<MetaFileEntity> list){ |
| | | String root=pathHelper.getConfig().getTempPath(); |
| | | |
| | | int count = 0; |
| | | for (MetaFileEntity entity : list) { |
| | | if (!StringHelper.isEmpty(entity.getPath())){ |
| | | String file=root+File.separator+entity.getPath(); |
| | | |
| | | File f=new File(file); |
| | | if (f.exists()){ |
| | | f.delete(); |
| | | count++; |
| | | } |
| | | } |
| | | } |
| | | |
| | | return count; |
| | | } |
| | | |
| | | /** |
| | | * 获取参数 |
| | | * Enumeration<String> headers = req.getHeaderNames(); |
| | | * Enumeration<String> attributes = req.getAttributeNames(); |