| | |
| | | import java.util.Objects; |
| | | import org.apache.commons.io.FilenameUtils; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import com.gkhy.common.config.expertConfig; |
| | | import com.gkhy.common.config.ExpertConfig; |
| | | import com.gkhy.common.constant.Constants; |
| | | import com.gkhy.common.exception.file.FileNameLengthLimitExceededException; |
| | | import com.gkhy.common.exception.file.FileSizeLimitExceededException; |
| | |
| | | /** |
| | | * 默认上传的地址 |
| | | */ |
| | | private static String defaultBaseDir = expertConfig.getProfile(); |
| | | private static String defaultBaseDir = ExpertConfig.getProfile(); |
| | | |
| | | public static void setDefaultBaseDir(String defaultBaseDir) |
| | | { |
| | |
| | | |
| | | public static final String getPathFileName(String uploadDir, String fileName) throws IOException |
| | | { |
| | | int dirLastIndex = expertConfig.getProfile().length() + 1; |
| | | int dirLastIndex = ExpertConfig.getProfile().length() + 1; |
| | | String currentDir = StringUtils.substring(uploadDir, dirLastIndex); |
| | | return Constants.RESOURCE_PREFIX + "/" + currentDir + "/" + fileName; |
| | | } |