Methods Summary |
---|
public synchronized org.apache.http.cookie.CookieSpec | getCookieSpec(java.lang.String name, org.apache.http.params.HttpParams params)Gets the {@link CookieSpec cookie specification} with the given ID.
if (name == null) {
throw new IllegalArgumentException("Name may not be null");
}
CookieSpecFactory factory = registeredSpecs.get(name.toLowerCase(Locale.ENGLISH));
if (factory != null) {
return factory.newInstance(params);
} else {
throw new IllegalStateException("Unsupported cookie spec: " + name);
}
|
public synchronized org.apache.http.cookie.CookieSpec | getCookieSpec(java.lang.String name)Gets the {@link CookieSpec cookie specification} with the given name.
return getCookieSpec(name, null);
|
public synchronized java.util.List | getSpecNames()Obtains a list containing names of all registered {@link CookieSpec cookie
specs} in their default order.
Note that the DEFAULT policy (if present) is likely to be the same
as one of the other policies, but does not have to be.
return new ArrayList<String>(registeredSpecs.keySet());
|
public synchronized void | register(java.lang.String name, org.apache.http.cookie.CookieSpecFactory factory)Registers a {@link CookieSpecFactory} with the given identifier.
If a specification with the given name already exists it will be overridden.
This nameis the same one used to retrieve the {@link CookieSpecFactory}
from {@link #getCookieSpec(String)}.
if (name == null) {
throw new IllegalArgumentException("Name may not be null");
}
if (factory == null) {
throw new IllegalArgumentException("Cookie spec factory may not be null");
}
registeredSpecs.put(name.toLowerCase(Locale.ENGLISH), factory);
|
public synchronized void | setItems(java.util.Map map)Populates the internal collection of registered {@link CookieSpec cookie
specs} with the content of the map passed as a parameter.
if (map == null) {
return;
}
registeredSpecs.clear();
registeredSpecs.putAll(map);
|
public synchronized void | unregister(java.lang.String id)Unregisters the {@link CookieSpecFactory} with the given ID.
if (id == null) {
throw new IllegalArgumentException("Id may not be null");
}
registeredSpecs.remove(id.toLowerCase(Locale.ENGLISH));
|