dap4/d4servlet/src/main/java/dap4/servlet/DapController.java
protected void
    addCommonHeaders(DapRequest drq)
            throws IOException
    {
        // Add relevant headers
        ResponseFormat format = drq.getFormat();
        if(format == null)
            format = ResponseFormat.NONE;
        DapProtocol.ContentType contentheaders = DapProtocol.contenttypes.get(drq.getMode());
        String header = contentheaders.getFormat(format);
        if(header != null) {
            header = header + "; charset=utf-8";
            drq.setResponseHeader("Content-Type", header);
        } else
            DapLog.error("Cannot determine response Content-Type");

        // Not sure what this should be yet
        //setHeader("Content-Description","?");

        // Again, not sure what value to use
        //setHeader("Content-Disposition","?");

        //not legal drq.setResponseHeader("Content-Encoding", IS_BIG_ENDIAN ? BIG_ENDIAN : LITTLE_ENDIAN);
    }
protected void
    addCommonHeaders(DapRequest drq)
            throws IOException
    {
        // Add relevant headers
        ResponseFormat format = drq.getFormat();
        if(format == null)
            format = ResponseFormat.NONE;
        DapProtocol.ContentType contentheaders = DapProtocol.contenttypes.get(drq.getMode());
        String header = contentheaders.getFormat(format);
        if(header != null) {
            header = header + "; charset=utf-8";
            drq.setResponseHeader("Content-Type", header);
        } else
            DapLog.error("Cannot determine response Content-Type");

        // Not sure what this should be yet
        //setHeader("Content-Description","?");

        // Again, not sure what value to use
        //setHeader("Content-Disposition","?");

        //not legal drq.setResponseHeader("Content-Encoding", IS_BIG_ENDIAN ? BIG_ENDIAN : LITTLE_ENDIAN);
    }
protected void addCommonHeaders ( DapRequest drq ) throws IOException { // Add relevant headers ResponseFormat format = drq . getFormat ( ) ; if ( format == null ) format = ResponseFormat . NONE ; DapProtocol . ContentType contentheaders = DapProtocol . contenttypes . get ( drq . getMode ( ) ) ; String header = contentheaders . getFormat ( format ) ; if ( header != null ) { header = header + "; charset=utf-8" ; drq . setResponseHeader ( "Content-Type" , header ) ; } else DapLog . error ( "Cannot determine response Content-Type" ) ; // Not sure what this should be yet //setHeader("Content-Description","?"); // Again, not sure what value to use //setHeader("Content-Disposition","?"); //not legal drq.setResponseHeader("Content-Encoding", IS_BIG_ENDIAN ? BIG_ENDIAN : LITTLE_ENDIAN); }
Utility Methods
Utility Methods