Merge remote-tracking branch 'origin/dev_shb' into develop
# Conflicts: # src/main/java/com/ai/da/service/impl/DesignServiceImpl.java
This commit is contained in:
@@ -5,27 +5,19 @@ import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.ai.da.common.config.exception.BusinessException;
|
||||
import com.ai.da.model.vo.FileVO;
|
||||
import org.apache.tomcat.util.http.fileupload.FileUtils;
|
||||
import org.apache.tomcat.util.http.fileupload.IOUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.util.FileSystemUtils;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.commons.CommonsMultipartFile;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.*;
|
||||
import java.net.URL;
|
||||
import java.security.MessageDigest;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
//import org.apache.poi.util.IOUtils;
|
||||
//import org.apache.poi.xssf.streaming.SXSSFSheet;
|
||||
|
||||
public class FileUtil extends cn.hutool.core.io.FileUtil {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(com.ai.da.common.utils.FileUtil.class);
|
||||
@@ -297,5 +289,20 @@ public class FileUtil extends cn.hutool.core.io.FileUtil {
|
||||
return files;
|
||||
}
|
||||
|
||||
// 判断文件是否存在
|
||||
public static boolean isFileExists(String filePath) {
|
||||
File file = new File(filePath);
|
||||
return file.exists() && file.isFile();
|
||||
}
|
||||
|
||||
// 根据路径获取文件
|
||||
public static File getFile(String filePath) {
|
||||
File file = new File(filePath);
|
||||
if (file.exists() && file.isFile()) {
|
||||
return file;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -172,6 +172,31 @@ public class MinioUtil {
|
||||
return fileName;
|
||||
}
|
||||
|
||||
// public String upload(String bucketName, String path, File file) {
|
||||
// InputStream in = null;
|
||||
// try {
|
||||
// in = new FileInputStream(file);
|
||||
// minioClient.putObject(PutObjectArgs.builder()
|
||||
// .bucket(bucketName)
|
||||
// .object(path)
|
||||
// .stream(in, in.available(), -1)
|
||||
// .contentType(file.getContentType())
|
||||
// .build()
|
||||
// );
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// } finally {
|
||||
// if (in != null) {
|
||||
// try {
|
||||
// in.close();
|
||||
// } catch (IOException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return fileName;
|
||||
// }
|
||||
|
||||
/**
|
||||
* description: 下载文件
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user