Clears the user info from an url.

@param systemID
the url to be cleaned.
@return the cleaned url, or null if the argument is not an URL.
186253
private static URL clearUserInfo(String systemID) {
    try {
      URL url = new URL(systemID);
      // Do not clear user info on "file" urls 'cause on Windows the drive will
      // have no ":"...
      if (!"file".equals(url.getProtocol())) {
        return attachUserInfo(url, null, null);
      }
      return url;
    } catch (MalformedURLException e) {
      return null;
    }
  }
1166641
public void deleteUser(Integer targetUserId) throws IOException {
        String tailUrl = GitlabUser.USERS_URL + "/" + targetUserId;
        retrieve().method(DELETE).to(tailUrl, Void.class);
    }
1055720
@Help(help = "Delete the Security of a NetworkServiceDescriptor with specific id")
  public void deleteSecurity(final String idNsd, final String idSecurity) throws SDKException {
    String url = idNsd + "/security" + "/" + idSecurity;
    requestDelete(url);
  }
549634
@Nonnull
  public EChange deleteUser (@Nullable final String sUserID)
  {
    final User aUser = getOfID (sUserID);
    if (aUser == null)
    {
      AuditHelper.onAuditDeleteFailure (User.OT, "no-such-user-id", sUserID);
      return EChange.UNCHANGED;
    }

    m_aRWLock.writeLock ().lock ();
    try
    {
      if (BusinessObjectHelper.setDeletionNow (aUser).isUnchanged ())
      {
        AuditHelper.onAuditDeleteFailure (User.OT, "already-deleted", sUserID);
        return EChange.UNCHANGED;
      }
      internalMarkItemDeleted (aUser);
    }
    finally
    {
      m_aRWLock.writeLock ().unlock ();
    }
    AuditHelper.onAuditDeleteSuccess (User.OT, sUserID);

    // Execute callback as the very last action
    m_aCallbacks.forEach (aCB -> aCB.onUserDeleted (aUser));

    return EChange.CHANGED;
  }
352765
private static String cleanSystemId(final String sysId)
    {
        int ix = sysId.indexOf('|');
        if (ix > 0 && URI_WINDOWS_FILE_PATTERN.matcher(sysId).matches()) {
            StringBuilder sb = new StringBuilder(sysId);
            sb.setCharAt(ix, ':');
            return sb.toString();
        }
        return sysId;
    }
92008
public void delete(URI uri, String assertedUserId) throws IOException {
		delete(uri, assertedUserId, null);
	}
921314
@Nonnull
  public EChange deleteUserGroup (@Nullable final String sUserGroupID)
  {
    if (StringHelper.hasNoText (sUserGroupID))
      return EChange.UNCHANGED;

    final UserGroup aDeletedUserGroup = getOfID (sUserGroupID);
    if (aDeletedUserGroup == null)
    {
      AuditHelper.onAuditDeleteFailure (UserGroup.OT, "no-such-usergroup-id", sUserGroupID);
      return EChange.UNCHANGED;
    }
    if (aDeletedUserGroup.isDeleted ())
    {
      AuditHelper.onAuditDeleteFailure (UserGroup.OT, "already-deleted", sUserGroupID);
      return EChange.UNCHANGED;
    }

    m_aRWLock.writeLock ().lock ();
    try
    {
      if (BusinessObjectHelper.setDeletionNow (aDeletedUserGroup).isUnchanged ())
      {
        AuditHelper.onAuditDeleteFailure (UserGroup.OT, "already-deleted", sUserGroupID);
        return EChange.UNCHANGED;
      }
      internalMarkItemDeleted (aDeletedUserGroup);
    }
    finally
    {
      m_aRWLock.writeLock ().unlock ();
    }
    AuditHelper.onAuditDeleteSuccess (UserGroup.OT, sUserGroupID);

    // Execute callback as the very last action
    m_aCallbacks.forEach (aCB -> aCB.onUserGroupDeleted (aDeletedUserGroup));

    return EChange.CHANGED;
  }
888321
public MockInternetGateway deleteInternetGateway(final String internetgatewayId) {
        if (internetgatewayId != null && allMockInternetGateways.containsKey(internetgatewayId)) {
            return allMockInternetGateways.remove(internetgatewayId);
        }

        return null;
    }
1023408
public void clearTenant(String tenantId) {
        String index = getIndex(tenantId);

        synchronized (knownIndices) {
            IndicesAdminClient indices = client.admin().indices();

            boolean indexExists = indices.prepareExists(index)
                    .execute()
                    .actionGet()
                    .isExists();

            if (indexExists) {
                indices.prepareDelete(index)
                        .execute()
                        .actionGet();
            }

            knownIndices.remove(index);
        }
    }
533272
public void unblockUser(Integer targetUserId) throws IOException {

        String tailUrl = GitlabUser.USERS_URL + "/" + targetUserId + GitlabUser.UNBLOCK_URL;

        retrieve().method(POST).to(tailUrl, Void.class);
    }
1082852
public boolean deleteGroup(String name)
	{
		if (ADMINISTRATOR_GROUP_ID.equals(name))
		{
			throw new SystemException(String.format("Cannot delete '%s' group.", ADMINISTRATOR_GROUP_ID));
		}

		if (USER_GROUP_ID.equals(name))
		{
			throw new SystemException(String.format("Cannot delete '%s' group.", USER_GROUP_ID));
		}

		if (!isGroupExist(name))
		{
			throw new SystemException(String.format("Group '%s' does not exist.", name));
		}

		if (getGroupUserCount(name) > 0)
		{
			throw new SystemException("Cannot delete a group containing users.");
		}

		return allGroups.remove(name);
	}
1164082
public static void clearSession(final String sessionId) {

		if (StringUtils.isBlank(sessionId)) {
			return;
		}

		final App app                            = StructrApp.getInstance();
		final PropertyKey<String[]> sessionIdKey = StructrApp.key(Principal.class, "sessionIds");
		final Query<Principal> query             = app.nodeQuery(Principal.class).and(sessionIdKey, new String[]{sessionId}).disableSorting();

		try {
			for (final Principal p : query.getAsList()) {

				p.removeSessionId(sessionId);
			}

		} catch (Exception fex) {

			logger.warn("Error while removing sessionId " + sessionId + " from all principals", fex);
		}

	}
555982
public QYResultType delete(String userId){
        BeanUtil.requireNonNull(userId, "userId is null");
        String url = BASE_API_URL + "cgi-bin/user/delete?access_token=#&userid=" + userId;
        BaseResponse response = executeGet(url);
        return QYResultType.get(response.getErrcode());
    }
566596
public void serviceName_users_userId_DELETE(String serviceName, String userId) throws IOException {
		String qPath = "/caas/registry/{serviceName}/users/{userId}";
		StringBuilder sb = path(qPath, serviceName, userId);
		exec(qPath, "DELETE", sb.toString(), null);
	}
1148794
public static void unregister(String ID) {
        displayNameCache.remove(new CaseInsensitiveString(ID));
        registry.remove(ID);
    }
1242412
public void remove(Identity oid)
    {
        if(log.isDebugEnabled()) log.debug("Remove object " + oid);
        sessionCache.remove(oid);
        getApplicationCache().remove(oid);
    }
1241596
public static URI getUserURI(final String sessionUserId) {
        // user id could be in format <anonymous>, remove < at the beginning and the > at the end in this case.
        final String userId = (sessionUserId == null ? "anonymous" : sessionUserId).replaceAll("^<|>$", "");
        try {
            final URI uri = URI.create(userId);
            // return useId if it's an absolute URI or an opaque URI
            if (uri.isAbsolute() || uri.isOpaque()) {
                return uri;
            } else {
                return buildDefaultURI(userId);
            }
        } catch (final IllegalArgumentException e) {
            return buildDefaultURI(userId);
        }
    }