CredentialOptions#jsonCredentials(InputStream) requires the InputStream to be open until it's used in BigtableSession #534
Labels
api: bigtable
Issues related to the googleapis/java-bigtable-hbase API.
When setting up credentials with
CredentialOptions#jsonCredentials(InputStream)
I was suprised to see that the resulting CredentialOptions require the InputStream to be open.My code uses an abstraction to setup CredentialOptions instances. The class itself does not expose any statefullness (i.e.
isReadable()
,close()
) meaning there's no reasonable way for a user of anCredentialOptions
instance to check if it's readable or not.I'd prefer if
CredentialOptions.jsonCredentials(InputStream)
fully read and parsed the given InputStream, and stored the credentials in memory, this would allow for patterns like the following to safely work without leaking an open InputStream.The kind of exceptions you'll see otherwise are the following:
The text was updated successfully, but these errors were encountered: