Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- 디자인패턴
- Linux
- designpattern
- decorator
- pscp
- NamedParameterNotBound
- 여러인수
- java
- setParameter
- BubbleSorting
- 자바
- @ModelAttribute
- createQuery
- C
- 데코레이터패턴
- mycp
- Spring
- springboot
- 숫자야구
- junit
- 백준
- @NotEmpty
- 점세개
- 자료구조
- 10951
- @Spring
- 쉬운 계단 수
- 전치행렬 #C
- 10844
- gradle
Archives
- Today
- Total
...
Spring Boot에서 gcp storage 사용 시 storage에 의존성 주입이 되지 않은 경우 본문
@Configuration
public class GoogleCloudStorageConfig {
@Bean
public Storage storage() throws IOException {
ClassPathResource resource = new ClassPathResource("key.json");
GoogleCredentials credentials = GoogleCredentials.fromStream(resource.getInputStream());
String projectId = "project id";
return StorageOptions.newBuilder()
.setProjectId(projectId)
.setCredentials(credentials)
.build()
.getService();
}
}
위와 같은 Configuration 파일을 만들어 storage 의존성을 직접 주입해준다........
'백엔드' 카테고리의 다른 글
RDBMS (MySQL vs PostgreSQL) 비교 (1) | 2024.12.01 |
---|---|
windows powershell에서 docker login 실행 안됨 (0) | 2023.08.18 |
Spring 3.x에 Swagger 적용하기 (0) | 2023.07.25 |
Spring CORS 에러 해결 (0) | 2023.07.25 |
Ec2 서버 배포 방법 정리 (0) | 2022.07.12 |