Java FileDataStoreFactory(Google API)的特定文件名

Java FileDataStoreFactory(Google API)的特定文件名,java,google-api,Java,Google Api,以前,如果我们使用的是FileCredentialStore,我们可以为凭证信息指定存储的文件名 但是,FileCredentialStore已折旧 现在,我们使用的是FileDataStoreFactory 然而,我们再也无法指定保存的文件名了。我们只能指定目录名。文件名将固定为StoredCredential 有什么方法可以指定文件名吗?因为我有不同的凭证信息,我想将它们分组到一个目录中。类似这样的内容: FileDataStoreFactory dataStoreFactory = ne

以前,如果我们使用的是
FileCredentialStore
,我们可以为凭证信息指定存储的文件名

但是,
FileCredentialStore
已折旧

现在,我们使用的是
FileDataStoreFactory

然而,我们再也无法指定保存的文件名了。我们只能指定目录名。文件名将固定为StoredCredential

有什么方法可以指定文件名吗?因为我有不同的凭证信息,我想将它们分组到一个目录中。

类似这样的内容:

FileDataStoreFactory dataStoreFactory = new FileDataStoreFactory("/path/to/dir");
DataStore<StoredCredential> dataStore = dataStoreFactory.getDataStore("specificFilename");
GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(
   httpTransport,JSON_FACTORY, clientSecrets, SCOPES)
   .setCredentialDataStore(dataStore).build();
FileDataStoreFactory dataStoreFactory=newfiledatastorefactory(“/path/to/dir”);
DataStore DataStore=dataStoreFactory.getDataStore(“specificFilename”);
GoogleAuthorizationCodeFlow=新建GoogleAuthorizationCodeFlow.Builder(
httpTransport、JSON_工厂、客户端机密、作用域)
.setCredentialDataStore(数据存储).build();