public void add(String mimeType,String extension){
  if (extension == null) {
    return;
  }
  Object value=mimeMappings.get(mimeType);
  String[] a=null;
  if (value instanceof String[]) {
    String[] old=(String[])value;
    a=new String[old.length + 1];
    System.arraycopy(old,0,a,0,old.length);
    a[a.length - 1]=extension;
    mimeMappings.put(mimeType,a);
  }
 else   if (value instanceof String) {
    a=new String[2];
    a[0]=(String)value;
    a[1]=extension;
    mimeMappings.put(mimeType,a);
  }
 else {
    mimeMappings.put(mimeType,extension);
  }
}

public void add ( String mimeType , String extension ) { if ( extension == null ) { return ; } Object value = mimeMappings . get ( mimeType ) ; String [ ] a = null ; if ( value instanceof String [ ] ) { String [ ] old = ( String [ ] ) value ; a = new String [ old . length + 1 ] ; System . arraycopy ( old , 0 , a , 0 , old . length ) ; a [ a . length - 1 ] = extension ; mimeMappings . put ( mimeType , a ) ; } else if ( value instanceof String ) { a = new String [ 2 ] ; a [ 0 ] = ( String ) value ; a [ 1 ] = extension ; mimeMappings . put ( mimeType , a ) ; } else { mimeMappings . put ( mimeType , extension ) ; } }
add file extension . keep the existing file extensions .
