CookieStoreMap.java (1083B)
1 package de.openrat.client.util; 2 3 import java.util.Collection; 4 import java.util.HashMap; 5 import java.util.Map; 6 7 public class CookieStoreMap 8 { 9 private Map<String, String> cookies = new HashMap<String, String>(); 10 11 /** 12 * @return 13 * @see java.util.Map#size() 14 */ 15 public int size() 16 { 17 return cookies.size(); 18 } 19 20 /** 21 * @param key 22 * @return 23 * @see java.util.Map#containsKey(java.lang.Object) 24 */ 25 public boolean containsKey(Object key) 26 { 27 return cookies.containsKey(key); 28 } 29 30 /** 31 * @param key 32 * @return 33 * @see java.util.Map#get(java.lang.Object) 34 */ 35 public String get(Object key) 36 { 37 return cookies.get(key); 38 } 39 40 /** 41 * @param key 42 * @param value 43 * @return 44 * @see java.util.Map#put(java.lang.Object, java.lang.Object) 45 */ 46 public String put(String key, String value) 47 { 48 return cookies.put(key, value); 49 } 50 51 /** 52 * @return 53 * @see java.util.Map#values() 54 */ 55 public Collection<String> values() 56 { 57 return cookies.values(); 58 } 59 60 public String getCookieRequestHeader() 61 { 62 63 return new MapConverter(cookies).convertMapToString("=", "; ", false); 64 } 65 }