File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -172,7 +172,7 @@ <h4>Example: Retrieve Datastore Entries</h4>
172172</ code > </ pre > </ div >
173173
174174 < div hljs ="" language ="java " ng-show ="selected == 'elsewhere' " class =""> < pre >
175- < code class ="hljs java "> import com.google.cloud.AuthCredentials ;
175+ < code class ="hljs java "> import com.google.auth.oauth2.GoogleCredentials ;
176176import com.google.cloud.datastore.Datastore;
177177import com.google.cloud.datastore.DatastoreOptions;
178178import com.google.cloud.datastore.Entity;
@@ -181,7 +181,7 @@ <h4>Example: Retrieve Datastore Entries</h4>
181181
182182DatastoreOptions options = DatastoreOptions.newBuilder()
183183 .setProjectId(< span class ="hljs-string "> PROJECT_ID</ span > )
184- .setAuthCredentials(AuthCredentials.createForJson (
184+ .setCredentials(GoogleCredentials.fromStream (
185185 new FileInputStream(< span class ="hljs-string "> PATH_TO_JSON_KEY</ span > ))).build();
186186Datastore datastore = options.getService();
187187KeyFactory keyFactory = datastore.newKeyFactory().setKind(< span class ="hljs-string "> KIND</ span > );
You can’t perform that action at this time.
0 commit comments