Last active
July 22, 2020 09:35
-
-
Save Ikhiloya/af04bf48ccc008fc34257a97255d5f5f to your computer and use it in GitHub Desktop.
Firebase Admin Storage initialization
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String bucketName = environment.getRequiredProperty("FIREBASE_BUCKET_NAME"); | |
String projectId = environment.getRequiredProperty("FIREBASE_PROJECT_ID"); | |
FileInputStream serviceAccount = | |
new FileInputStream("/home/user/Downloads/service-account-file.json"); | |
StorageOptions.newBuilder() | |
.setProjectId(projectId) | |
.setCredentials(GoogleCredentials.fromStream(serviceAccount)) | |
.build(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment