I'm able to send the file in GCS Bucket as an attachment using Sendgrid API. However, I'm not able to do the same with the file present in the local system.
The code I've used for GCS file transfer is
StorageOptions options = StorageOptions.newBuilder()
.setProjectId(PROJECT_ID)
.setCredentials(GoogleCredentials.fromStream(
new FileInputStream(PATH_TO_JSON_KEY))).build();
Storage storage = options.getService();
Blob blob = storage.get(BUCKET_NAME, OBJECT_NAME);
Using the above code I am able to read the content of the data, but how can we use that function if our file is in local system rather than GCS Bucket?