private static String getJavaScriptFile(String path) {
        StringBuilder sb = new StringBuilder();
        try (InputStream in = getResourceAsStream(path)) {
            if (in == null) {
                Log.error("Unable to find javascript file: '" + path + "' in classpath");
                return "";
            }

            try (BufferedReader br = new BufferedReader(new InputStreamReader(in, StandardCharsets.ISO_8859_1))) {
                String line;
                while ((line = br.readLine()) != null) {
                    sb.append(line.trim()).append('\n');
                }
            }
        } catch (Exception e) {
            Log.error("Error loading JavaScript file: '" + path + "'.", e);
        }

        return sb.toString();
    }
Combines and serves resources, such as javascript or css files.
xmppserver/src/main/java/org/jivesoftware/openfire/http/ResourceServlet.java