public FileInfo delete(String accountName, FileInfo file) throws MultiCloudException, OAuth2SettingsException, InterruptedException {
		synchronized (lock) {
			if (op != null) {
				throw new MultiCloudException("Concurrent operation forbidden.");
			}
		}
		AccountSettings account = accountManager.getAccountSettings(accountName);
		if (account == null) {
			throw new MultiCloudException("User account not found.");
		}
		if (!account.isAuthorized()) {
			throw new MultiCloudException("User account not authorized.");
		}
		CloudSettings settings = cloudManager.getCloudSettings(account.getSettingsId());
		if (settings == null) {
			throw new MultiCloudException("Cloud storage settings not found.");
		}
		OAuth2Token token = credentialStore.retrieveCredential(account.getTokenId());
		if (token == null) {
			account.setTokenId(null);
			throw new MultiCloudException("Access token not found.");
		}
		if (token.isExpired()) {
			refreshAccount(accountName, null);
		}
		if (file == null) {
			throw new MultiCloudException("File or folder must be supplied.");
		}
		synchronized (lock) {
			op = new DeleteOp(token, settings.getDeleteRequest(), file);
		}
		try {
			op.execute();
		} catch (MultiCloudException e) {
			synchronized (lock) {
				op = null;
			}
			throw e;
		}
		lastError = op.getError();
		if (op.isAborted()) {
			synchronized (lock) {
				op = null;
			}
			throw new AbortedException("Operation aborted.");
		}
		FileInfo result = ((DeleteOp) op).getResult();
		synchronized (lock) {
			op = null;
		}
		return result;
	}