Skip to content

Instantly share code, notes, and snippets.

@LNA
Created February 3, 2015 22:56
Show Gist options
  • Save LNA/d9b2e35c24226f43e282 to your computer and use it in GitHub Desktop.
Save LNA/d9b2e35c24226f43e282 to your computer and use it in GitHub Desktop.
if (requestURI.equals("/patch-content.txt")) {
String fileOneString = "../cob_spec/public" + requestURI;
System.out.println(fileOneString);
FileWriter fw = new FileWriter(fileOneString, APPEND);
fw.write(DEFAULT_RESPONSE);
System.out.println("it gets here");
} else if (Arrays.asList("/file1", "/file2", "/image.jpeg", "/image.png", "/image.gif", "/text-file.txt").contains(requestURI)) {
byte[] body = pageBuilder.getBody(requestURI);
out.write(body);
out.flush();
} else if (requestURI.equals("/partial_content.txt")) {
byte[] body = pageBuilder.handleRange(requestURI, range);
out.write(body);
out.flush();
} else if (requestURI.equals("/logs")) {
byte[] body = pageBuilder.getLogs();
out.write(body);
out.flush();
} else if (requestURI.contains("/parameters")) {
byte[] body = pageBuilder.decodeParams(requestURI);
out.write(body);
out.flush();
} else {
byte[] body = pageBuilder.getBodyLinks();
out.write(body);
out.flush();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment