String (@NotNull Class<?> resourceContainerClass, @NonNls @NotNull String fileName) { try (InputStream stream = resourceContainerClass.getClassLoader().getResourceAsStream("codeStyle/preview/" + fileName); LineNumberReader lineNumberReader = stream == null ? null : new LineNumberReader(new InputStreamReader(stream, StandardCharsets.UTF_8))) { if (stream == null) throw new IOException("Resource not found: " + "codeStyle/preview/" + fileName); final StringBuilder result = new StringBuilder(); String line; while ((line = lineNumberReader.readLine()) != null) { result.append(line); result.append("\n"); } return result.toString(); } catch (IOException e) { LOG.error("Cannot load codestyle preview from" + fileName, e); return ""; } }