Project

General

Profile

« Previous | Next » 

Revision 7757

use ContentTypeInputStream interface (and ByteArray implementation) to specify the desired content-type of the InputStream returned by MN.query().

View differences:

SolrQueryResponseWriterFactory.java
86 86
        }
87 87
        return writer;
88 88
    }
89

  
90
	public static String getContentType(String wt) {
91
		String contentType = null;
92
		if (wt == null || wt.trim().equals("") || wt.equals(XML)) {
93
			contentType = "text/xml";
94
		} else if (wt.equals(JSON)) {
95
			contentType = "text/json";
96
		} else if (wt.equals(PYTHON)) {
97
			contentType = "text/plain";
98
		} else if (wt.equals(RUBY)) {
99
			contentType = "text/plain";
100
		} else if (wt.equals(PHP)) {
101
			contentType = "text/plain";
102
		} else if (wt.equals(PHPS)) {
103
			contentType = "text/plain";
104
		} else if (wt.equals(VELOCITY)) {
105
			contentType = "text/html";
106
		} else if (wt.equals(CSV)) {
107
			contentType = "text/csv";
108
		} else {
109
			// just don't know what it is...
110
			contentType = null;
111
		}
112
		return contentType;
113
	}
89 114
}

Also available in: Unified diff