Here you can find the source of extractDirective(HashMap
Parameter | Description |
---|---|
key | A non-null String challenge token name. |
value | A non-null String token value. |
Parameter | Description |
---|---|
SaslException | if either the key or the value is null orif the key already has a value. |
private static void extractDirective(HashMap<String, String> map, String key, String value) throws SaslException
//package com.java2s; /**//w w w. j a va2s .co m * Copyright 2007-2016, Kaazing Corporation. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import java.util.HashMap; import javax.security.sasl.SaslException; public class Main { /** * Processes directive/value pairs from the digest-challenge and * fill out the provided map. * * @param key A non-null String challenge token name. * @param value A non-null String token value. * @throws SaslException if either the key or the value is null or * if the key already has a value. */ private static void extractDirective(HashMap<String, String> map, String key, String value) throws SaslException { if (map.get(key) != null) { throw new SaslException("Peer sent more than one " + key + " directive"); } map.put(key, value); } }