While connecting to Google Cloud Storage using Java libraries, We are getting below exception :

1. Caused by: java.net.UnknownHostException: oauth2.googleapis.com
2. Caused by: java.io.IOException: Error getting access token for service account: oauth2.googleapis.com

We have created the Google Cloud Storage service account, Project and downloaded JSON file also.

Below is the code snippet :

```
GoogleCredentials googleCredentails = 
            ServiceAccountCredentials.fromStream(new FileInputStream("D:\\Naresh\\Projects\\GoogleCloudStorage\\delta-trees-236311-ae7c1cfcda68.json"));

Storage googleStorageService = StorageOptions.newBuilder().setCredentials(googleCredentails)
            .setProjectId("delta-trees-236311")
            .build().getService();

String googleBucketName = "ewf-ocr-poc";
File f = new File("D:\\Naresh\\Projects\\GoogleCloudStorage\\EWFDocumentThroughJava.txt");
byte[] readFileToByteArray = readFileToByteArray(f);
String fileName = f.getName();
InputStream fis = new FileInputStream(f);        
googleStorageService.create(BlobInfo.newBuilder(googleBucketName, fileName).build(),
            readFileToByteArray);

```