| | |
| | | package com.lf.server.helper; |
| | | |
| | | import com.lf.server.entity.data.MetaFileEntity; |
| | | import com.lf.server.service.data.UploaderService; |
| | | import org.apache.commons.codec.digest.DigestUtils; |
| | | import org.apache.commons.logging.Log; |
| | | import org.apache.commons.logging.LogFactory; |
| | |
| | | |
| | | file.delete(); |
| | | } |
| | | |
| | | /** |
| | | * 获取相对路径 |
| | | * |
| | | * @param file 文件 |
| | | * @return 相对路径 |
| | | */ |
| | | public static String getRelativePath(String file) { |
| | | if (StringHelper.isEmpty(file)) { |
| | | return null; |
| | | } |
| | | |
| | | int idx = file.lastIndexOf(File.separator); |
| | | int start = file.lastIndexOf(File.separator, idx - 1); |
| | | |
| | | return file.substring(start + 1); |
| | | } |
| | | } |