Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: credentials.json 경로 변경 #165

Merged
merged 1 commit into from
Nov 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@
import lombok.Getter;
import org.springframework.context.annotation.Configuration;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.*;
import java.util.Collections;
import java.util.List;

Expand All @@ -39,12 +36,12 @@ public class GoogleDocsConfig {
private static final List<String> SCOPES =
Collections.singletonList(DocsScopes.DOCUMENTS_READONLY);
// OAuth 2.0 credentials.json 경로 지정
private static final String CREDENTIALS_FILE_PATH = "/credentials.json";
private static final String CREDENTIALS_FILE_PATH = "./src/main/resources/credentials.json";

public static Credential getCredentials(final NetHttpTransport HTTP_TRANSPORT)
throws IOException {
// credentials.json 가져오기
InputStream in = GoogleDocsApiBatchService.class.getResourceAsStream(CREDENTIALS_FILE_PATH);
InputStream in = new FileInputStream(CREDENTIALS_FILE_PATH);
if (in == null) {
throw new FileNotFoundException("Resource not found: " + CREDENTIALS_FILE_PATH);
}
Expand Down