Changeset 20756


Ignore:
Timestamp:
01/03/10 15:52:27 (2 years ago)
Author:
rns
Message:

Use standard chemical/x-fasta MIME type for sequence export.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/bio/webapp/src/org/intermine/bio/web/export/SequenceHttpExporter.java

    r20462 r20756  
    5858            ResponseUtil.setGzippedHeader(response, fileName + ".gz"); 
    5959        } else { 
    60             ResponseUtil.setPlainTextHeader(response, fileName); 
     60            ResponseUtil.setCustomTypeHeader(response, fileName, "chemical/x-fasta"); 
    6161        } 
    6262    } 
  • trunk/intermine/web/main/src/org/intermine/web/logic/export/ResponseUtil.java

    r20462 r20756  
    9393 
    9494    /** 
     95     * Sets response header and content type for a custom content type. 
     96     * @param response response 
     97     * @param fileName file name of downloaded file 
     98     * @param the content type to use 
     99     */ 
     100    public static void setCustomTypeHeader(HttpServletResponse response, String fileName, 
     101            String contentType) { 
     102        setNoCache(response); 
     103        setCustomContentType(response, contentType); 
     104        setFileName(response, fileName); 
     105    } 
     106     
     107    /** 
    95108     * Sets that the result must not be cached. Old implementation was set 
    96109     * Cache-Control to no-cache,no-store,max-age=0. But this caused problems 
     
    175188 
    176189    /** 
     190     * Sets content type to the parameter specified 
     191     * @param response response 
     192     * @param custom MIME type to set as content type specified 
     193     */ 
     194    public static void setCustomContentType(HttpServletResponse response, String contentType) { 
     195        response.setContentType(contentType); 
     196    } 
     197    /** 
    177198     * Sets the content disposition filename. 
    178199     * 
Note: See TracChangeset for help on using the changeset viewer.