@@ -0,0 +1,1566 @@
+package org.intermine.webservice.server;%0A%0Aimport java.util.Arrays;%0Aimport java.util.HashSet;%0Aimport java.util.Set;%0A%0Apublic enum Format %7B%0A%0A    /** The format for when no value is given **/%0A    EMPTY(null),%0A    /** The Unknown format **/%0A    UNKNOWN(null),%0A    /** The HTML format **/%0A    HTML(%22text/html%22),%0A    /** Plain Text **/%0A    TEXT(%22text/plain%22),%0A    /** XML **/%0A    XML(%22application/xml%22),%0A    /** Comma-separated-values **/%0A    CSV(%22text/comma-separated-values%22),%0A    /** Tab-separated-values **/%0A    TSV(%22text/tab-separated-values%22),%0A    /** Vanilla-JSON **/%0A    JSON(%22application/json%22),%0A    /** JSON Object format constant **/%0A    OBJECTS(%22application/json;format=objects%22),%0A    /** JSON Table format constant **/%0A    TABLE(%22application/json;format=table%22),%0A    /** JSON Row format constant **/%0A    ROWS(%22application/json;format=rows%22);%0A%0A    public static final Set%3CFormat%3E BASIC_FORMATS = new HashSet%3CFormat%3E(Arrays.asList(%0A        HTML, TEXT, XML, JSON%0A    ));%0A%0A    public static final Set%3CFormat%3E JSON_FORMATS = new HashSet%3CFormat%3E(Arrays.asList(%0A        JSON, OBJECTS, TABLE, ROWS%0A    ));%0A%0A    public static final Set%3CFormat%3E FLAT_FILES = new HashSet%3CFormat%3E(Arrays.asList(%0A        TSV, CSV%0A    ));%0A    %0A    private final String contentType;%0A%0A    private Format(String contentType) %7B%0A        this.contentType = contentType;%0A    %7D%0A%0A    public String getContentType() %7B%0A        return contentType;%0A    %7D%0A%0A    @Override%0A    public String toString() %7B%0A        return super.toString() + ((contentType == null) ? %22%22 : (%22 (%22 + contentType + %22) %22));%0A    %7D%0A%0A%7D%0A

Move to a much cleaner format implementation