파일확인
This commit is contained in:
@@ -1,5 +1,9 @@
|
|||||||
package com.madeu.config;
|
package com.madeu.config;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.core.io.Resource;
|
import org.springframework.core.io.Resource;
|
||||||
@@ -10,9 +14,6 @@ import org.springframework.web.util.UriUtils;
|
|||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Configuration
|
@Configuration
|
||||||
public class WebConfig implements WebMvcConfigurer {
|
public class WebConfig implements WebMvcConfigurer {
|
||||||
@@ -40,7 +41,21 @@ public class WebConfig implements WebMvcConfigurer {
|
|||||||
log.info("디코딩된 Resource Path: {}", decodedResourcePath);
|
log.info("디코딩된 Resource Path: {}", decodedResourcePath);
|
||||||
log.info("Location: {}", location.getURI());
|
log.info("Location: {}", location.getURI());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Resource requestedResource = location.createRelative(decodedResourcePath);
|
Resource requestedResource = location.createRelative(decodedResourcePath);
|
||||||
|
// 상세 파일 정보 로깅
|
||||||
|
try {
|
||||||
|
File file = requestedResource.getFile();
|
||||||
|
log.info("실제 파일 경로: {}", file.getAbsolutePath());
|
||||||
|
log.info("파일 존재 여부: {}", file.exists());
|
||||||
|
log.info("파일 읽기 권한: {}", file.canRead());
|
||||||
|
log.info("파일 크기: {} bytes", file.length());
|
||||||
|
log.info("파일인지 여부: {}", file.isFile());
|
||||||
|
log.info("디렉토리인지 여부: {}", file.isDirectory());
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("파일 정보 조회 실패", e);
|
||||||
|
}
|
||||||
|
|
||||||
boolean exists = requestedResource.exists();
|
boolean exists = requestedResource.exists();
|
||||||
boolean readable = exists && requestedResource.isReadable();
|
boolean readable = exists && requestedResource.isReadable();
|
||||||
|
|||||||
Reference in New Issue
Block a user