--- layout: default navsection: sdk navmenu: Java title: "Examples" ... {% comment %} Copyright (C) The Arvados Authors. All rights reserved. SPDX-License-Identifier: CC-BY-SA-3.0 {% endcomment %} h2. Initialize SDK
import org.arvados.sdk.Arvados;
String apiName = "arvados"; String apiVersion = "v1"; Arvados arv = new Arvados(apiName, apiVersion);h2. create
Maph2. deletecollection = new HashMap (); collection.put("name", "create example"); Map params = new HashMap (); params.put("collection", collection); Map response = arv.call("collections", "create", params);
Maph2. getparams = new HashMap (); params.put("uuid", uuid); Map response = arv.call("collections", "delete", params);
params = new HashMaph2. list(); params.put("uuid", userUuid); Map response = arv.call("users", "get", params);
Maph2. updateparams = new HashMap (); Map response = arv.call("users", "list", params); // get uuid of the first user from the response List items = (List)response.get("items"); Map firstUser = (Map)items.get(0); String userUuid = (String)firstUser.get("uuid");
Maph2. Get current usercollection = new HashMap (); collection.put("name", "update example"); Map params = new HashMap (); params.put("uuid", uuid); params.put("collection", collection); Map response = arv.call("collections", "update", params);
Mapparams = new HashMap (); Map response = arv.call("users", "current", params);