Skip to content

Commit 6b60ef5

Browse files
committed
update datastore snippet in front page
1 parent 3beba47 commit 6b60ef5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/site/resources/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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;
176176
import com.google.cloud.datastore.Datastore;
177177
import com.google.cloud.datastore.DatastoreOptions;
178178
import com.google.cloud.datastore.Entity;
@@ -181,7 +181,7 @@ <h4>Example: Retrieve Datastore Entries</h4>
181181

182182
DatastoreOptions 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();
186186
Datastore datastore = options.getService();
187187
KeyFactory keyFactory = datastore.newKeyFactory().setKind(<span class="hljs-string">KIND</span>);

0 commit comments

Comments
 (0)