Is there a way to read files from google cloud storage bucket using ConfigFactory.?

188 views Asked by At

I have to read configs from local path(for unit test) and from gcs bucket when running from dataproc cluster. The code I have written is:

val appConf = ConfigFactory.parseFile(new File(pathToFile))
appConf.getConfigList("params")

This code is working fine when reading from local path like /tmp/dir/file.conf

But when passing path as gs://bucket/folder/file.conf I am getting error: No configuration setting found for key 'params'. Is there a common way to read config from both local and gs bucket.? Or Is there any other way to do it in some common way.?

Thanks

1

There are 1 answers

0
Robert G On

As per the previous comment of a community member:

Extend the File class and implement the Cloud Storage logic in it. There is nothing out of the box.