Skip to content

Instantly share code, notes, and snippets.

@Ikhiloya
Created July 20, 2020 05:47
Show Gist options
  • Save Ikhiloya/deda068282a66f4c522c396722c7efff to your computer and use it in GitHub Desktop.
Save Ikhiloya/deda068282a66f4c522c396722c7efff to your computer and use it in GitHub Desktop.
Firebase Admin Storage initialization
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");
this.storageOptions = 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