change 3 path

This commit is contained in:
Kana
2024-01-25 16:45:25 +09:00
parent c4d6561011
commit 90dffc18fd
3 changed files with 13 additions and 13 deletions

View File

@@ -91,8 +91,14 @@ public class ExcelDownlodeUtils {
//확장자는 .xlsx로 해주세요.
//매개변수는 HttpServletResponse response와 파일명 String을 넣으면 되고 파일명은 한글도 가능합니다.
public void downlodeExcelForm(HttpServletResponse response, String formName) throws IOException {
String excelfilesDirectory = "src/main/webapp/excelfiles/excelform/";
//String excelfilesDirectory = "D:/excel/form/";
String excelfilesDirectory = "/excel/form/";
File saveFolder = new File(EgovWebUtil.filePathBlackList(excelfilesDirectory));
if (!saveFolder.exists() || saveFolder.isFile()) {
saveFolder.mkdirs();
}
File file = new File(excelfilesDirectory+formName);

View File

@@ -24,7 +24,8 @@ public class ExcelRequestManager {
String storePathString = "";
String atchFileIdString = "";
String folder = request.getServletContext().getRealPath("/");
// String folder = "D:/excel";
String folder = "/excel";
if ("".equals(storePath) || storePath == null) {
storePathString = folder+"/excelfiles/upload/";

View File

@@ -20,19 +20,12 @@ public class ImgService {
String storePathString = "";
try {
//대안1
//InputStream resource = getClass().getResourceAsStream("/static/img/mypage/profile");
//ClassPathResource resource = new ClassPathResource("/static/img/mypage/profile");
//storePathString = "D:/static/img/mypage/profile";
storePathString = "/static/img/mypage/profile";
//resource.getFile().getAbsolutePath();
//대안2
//InputStream resource = getClass().getClassLoader().getResourceAsStream("static/img/mypage/profile");
//기존
ClassPathResource resource = new ClassPathResource("/static/img/mypage/profile");
storePathString = resource.getFile().getAbsolutePath();
} catch (Exception e) {
e.printStackTrace();
}