MIME type
This commit is contained in:
Regular → Executable
+1
@@ -36,6 +36,7 @@ public class ControllerResponse {
|
||||
|
||||
private static final String MIME_DEFAULT = "text/plain";
|
||||
|
||||
// TODO Tilman Das ist der übergebene MIME-Type
|
||||
public static final String MIME_XML = "text/xml";
|
||||
|
||||
public static final String MIME_HTML = "text/html";
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
package net.sf.wikiinajar.xrays;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
@@ -203,8 +204,12 @@ public class HttpServer extends NanoHTTPD {
|
||||
|
||||
|
||||
|
||||
// TODO Tilman Hier geht es los
|
||||
boolean serverSideXslt = true;
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
|
||||
if (serverSideXslt) {
|
||||
|
||||
// Hier geht es los
|
||||
String xsltFileName = "public/skins/default/master.xsl";
|
||||
|
||||
|
||||
@@ -227,11 +232,12 @@ public class HttpServer extends NanoHTTPD {
|
||||
}
|
||||
|
||||
try {
|
||||
trans.transform(xmlSource, new StreamResult(System.out));
|
||||
trans.transform(xmlSource, new StreamResult(baos));
|
||||
} catch (TransformerException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -244,7 +250,7 @@ public class HttpServer extends NanoHTTPD {
|
||||
|
||||
|
||||
// TODO Hier evtl. noch den MIME type ändern
|
||||
Response serverResponse = newNoChacheResponse(HTTP_OK, response.getMime(), fullFile);
|
||||
Response serverResponse = newNoChacheResponse(HTTP_OK, response.getMime(), baos.toString());
|
||||
|
||||
|
||||
return serverResponse;
|
||||
|
||||
Reference in New Issue
Block a user