forked from I2P_Developers/i2p.i2p
susimail: Removed remaining Jetty dependencies in susimail (ticket #1165)
Thanks for the patch, wockenfuss!
This commit is contained in:
@@ -29,7 +29,8 @@ import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
//import org.apache.commons.logging.Log;
|
||||
//import org.mortbay.log.LogFactory;
|
||||
import org.eclipse.jetty.util.MultiMap;
|
||||
//import org.eclipse.jetty.util.MultiMap;
|
||||
import org.mortbay.util.MultiMap;
|
||||
import org.mortbay.util.LineInput;
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
|
45
apps/susimail/src/src/org/mortbay/util/MultiMap.java
Normal file
45
apps/susimail/src/src/org/mortbay/util/MultiMap.java
Normal file
@@ -0,0 +1,45 @@
|
||||
package org.mortbay.util;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class MultiMap<T>
|
||||
{
|
||||
HashMap<T, LinkedList<Object>> data;
|
||||
|
||||
public MultiMap(int i)
|
||||
{
|
||||
data = new HashMap<T, LinkedList<Object>>();
|
||||
}
|
||||
|
||||
public Set<T> keySet()
|
||||
{
|
||||
return data.keySet();
|
||||
}
|
||||
|
||||
public Object get(T key)
|
||||
{
|
||||
List<Object> tmp = getValues(key);
|
||||
|
||||
return tmp != null ? tmp.get( 0 ) : null;
|
||||
}
|
||||
|
||||
public List<Object> getValues(T key)
|
||||
{
|
||||
return data.get( key );
|
||||
}
|
||||
|
||||
public void add(T key, Object value )
|
||||
{
|
||||
LinkedList<Object> list = data.get( key );
|
||||
|
||||
if( list == null ) {
|
||||
list = new LinkedList<Object>();
|
||||
data.put( key, list );
|
||||
}
|
||||
|
||||
list.add( value );
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user