@@ -0,0 +1,1536 @@
+package org.cobbzilla.util.http;%0A%0Aimport lombok.AllArgsConstructor;%0Aimport lombok.Getter;%0Aimport lombok.NoArgsConstructor;%0Aimport lombok.Setter;%0Aimport lombok.experimental.Accessors;%0A%0Aimport static org.cobbzilla.util.daemon.ZillaRuntime.empty;%0A%0A@NoArgsConstructor @AllArgsConstructor @Accessors(chain=true)%0Apublic class HttpContentTypeAndCharset %7B%0A%0A    @Getter @Setter private String contentType;%0A    public boolean hasContentType () %7B return !empty(contentType); %7D%0A%0A    public boolean isContentType(String type) %7B%0A        return hasContentType() && contentType.equalsIgnoreCase(type);%0A    %7D%0A%0A    @Getter @Setter private String charset;%0A    public boolean hasCharset () %7B return !empty(charset); %7D%0A%0A    public boolean isCharset(String cs) %7B%0A        return hasCharset() && charset.equalsIgnoreCase(cs);%0A    %7D%0A%0A    public HttpContentTypeAndCharset (String val) %7B%0A        if (!empty(val)) %7B%0A            final int semiPos = val.indexOf(';');%0A            if (semiPos == -1) %7B%0A                contentType = val.trim();%0A            %7D else %7B%0A                contentType = val.substring(0, semiPos).trim();%0A                if (semiPos %3C val.length()-1) %7B%0A                    for (String part : val.substring(semiPos + 1).split(%22;%22)) %7B%0A                        final String%5B%5D params = part.split(%22=%22);%0A                        if (params.length == 2 && params%5B0%5D.equalsIgnoreCase(%22charset%22)) %7B%0A                            charset = params%5B1%5D.trim();%0A                        %7D%0A                    %7D%0A                %7D%0A            %7D%0A        %7D%0A    %7D%0A%7D%0A

add HttpContentTypeAndCharset