private void addSharingProfiles(Collection<SharingProfile> sharingProfiles) throws GuacamoleException {
  for (  SharingProfile sharingProfile : sharingProfiles) {
    String primaryConnectionIdentifier=sharingProfile.getPrimaryConnectionIdentifier();
    APIConnection primaryConnection=retrievedConnections.get(primaryConnectionIdentifier);
    if (primaryConnection != null) {
      Collection<APISharingProfile> children=primaryConnection.getSharingProfiles();
      if (children == null) {
        children=new ArrayList<APISharingProfile>();
        primaryConnection.setSharingProfiles(children);
      }
      children.add(new APISharingProfile(sharingProfile));
    }
 else     logger.debug("Sharing profile \"{}\" cannot be added to the " + "tree: primary connection \"{}\" does not actually " + "exist.",sharingProfile.getIdentifier(),primaryConnectionIdentifier);
  }
}

private void addSharingProfiles ( Collection < SharingProfile > sharingProfiles ) throws GuacamoleException { for ( SharingProfile sharingProfile : sharingProfiles ) { String primaryConnectionIdentifier = sharingProfile . getPrimaryConnectionIdentifier ( ) ; APIConnection primaryConnection = retrievedConnections . get ( primaryConnectionIdentifier ) ; if ( primaryConnection != null ) { Collection < APISharingProfile > children = primaryConnection . getSharingProfiles ( ) ; if ( children == null ) { children = new ArrayList < APISharingProfile > ( ) ; primaryConnection . setSharingProfiles ( children ) ; } children . add ( new APISharingProfile ( sharingProfile ) ) ; } else logger . debug ( "Sharing profile \"{}\" cannot be added to the " + "tree: primary connection \"{}\" does not actually " + "exist." , sharingProfile . getIdentifier ( ) , primaryConnectionIdentifier ) ; } }
adds each of the provided sharing profiles to the current tree as children of their respective primary connections . the primary connections must already be added .
