파닥이

[spring] 리소스 파일 읽기 본문

IT/Spring

[spring] 리소스 파일 읽기

알라이또 2019. 8. 21. 15:43
반응형

http://june0313.github.io/2018/08/11/read-resource-file-on-spring/

 

스프링 프로젝트에서 리소스 파일 읽기

리소스(Resource)Maven이나 Gradle을 사용하여 스프링 프로젝트를 만들게 되면 src/main/resources 디렉토리에 리소스 파일을 저장하게 되어있습니다. *.java 파일처럼 컴파일 대상이 되는 소스파일이 아닌 파일들을 리소스 디렉토리에 저장하여 관리합니다. 1234src - main - java (소스파일을 저장)

june0313.github.io

https://m.blog.naver.com/PostView.nhn?blogId=lovej804&logNo=220629864134&proxyReferer=https%3A%2F%2Fwww.google.com%2F

 

JAVA path중 java.nio.file.InvalidPathException: Illegal char <:> 에러시

nested exception is java.nio.file.InvalidPathException: Illegal char <:> at index 2: /C:/...

blog.naver.com

https://mommoo.tistory.com/87

 

[Java] 파일 경로 처리하기.

안녕하세요. 오늘은 Java를 이용하여, OS에 호환 되는 파일 경로 구성 방법과 웹 경로에 사용되는 / 문자열을 OS에 맞게, 파일 구분자로 변환하는 방법을 간단하게 포스팅 합니다. OS마다 서로 다른 파일 구분자..

mommoo.tistory.com

 

```

import org.springframework.core.io.ClassPathResource;

import java.nio.file.Path;
import java.nio.file.Paths;

 

 

ClassPathResource resource = new ClassPathResource("config/properties");
String path = Paths.get(resource.getURI()).toString();

```

 

 

https://www.mkyong.com/java/java-read-a-file-from-resources-folder/

 

Java – Read a file from resources folder – Mkyong.com

In this tutorial, we will show you how to read a file from a resources folder or classpath, in both runtime and unit test environment. Try putting a file into the src/main/resources folder, and read the file with following code snippets : 1. getResource Fi

www.mkyong.com

 

https://blog.outsider.ne.kr/794

 

[Spring 레퍼런스] 5장 리소스 #1 :: Outsider's Dev Story

이 문서는 개인적인 목적이나 배포하기 위해서 복사할 수 있다. 출력물이든 디지털 문서든 각 복사본에 어떤 비용도 청구할 수 없고 모든 복사본에는 이 카피라이트 문구가 있어야 한다.5. 리소스5.1 소개자바의...

blog.outsider.ne.kr

 

Comments