Hi A/all
I have an ArcGIS Online account and I'd like to access from a Java Application a content(Feature Layer) hosted with Organization scope.
I tried to write in Java the equivalent of this Python code(that works!):
UserCredential credential = new UserCredential("my_user", "my_password!");final Portal portalOnline = new Portal("https://my_organization.maps.arcgis.com");portalOnline.setCredential(credential);portalOnline.addDoneLoadingListener(() -> {if (portalOnline.getLoadStatus() == LoadStatus.LOADED) { PortalUser user = portalOnline.getUser();// Returns display name of authenticated user. String userDisplayName = user.getFullName(); System.out.println(userDisplayName); PortalItem portalItem = new PortalItem(portalOnline, "f0d17c247_content_id"); portalItem.getAccess(); portalItem.addDoneLoadingListener(() -> {if (portalItem.getLoadStatus() == LoadStatus.LOADED) {if (portalItem.getType() == PortalItem.Type.FEATURE_SERVICE) { } } }); portalItem.loadAsync(); }});portalOnline.loadAsync();
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.