Skip to content
Snippets Groups Projects
Commit 55ddb95c authored by SPTimmer's avatar SPTimmer
Browse files

tenth commit - last commit before submission, for real this time

parent 8468844a
No related branches found
No related tags found
No related merge requests found
......@@ -17,14 +17,14 @@ public class ResourceHandler {
InputStream stream = new FileInputStream(file);
StringBuilder builder = new StringBuilder();
try (Reader reader = new BufferedReader(new InputStreamReader(stream, StandardCharsets.UTF_8))) {
int c;
while (-1 != (c = reader.read())) {
builder.append((char) c);
int ch;
while (-1 != (ch = reader.read())) {
builder.append((char) ch);
}
}
content = builder.toString();
} catch (NullPointerException | IOException ignored) {
content = "<!DOCTYPE HTML>\n<html><head><title>Oops</title></head><body>Something went wrong.</body></html>";
content = "<!DOCTYPE HTML>\n<html><head><title>Oops</title></head><body style='color:red'>Something went wrong.</body></html>";
}
return content;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment