private ModelAndView processFile()

in server/src/jetbrains/buildServer/staticUIExtensions/web/StaticContentController.java [82:108]


  private ModelAndView processFile(@Nullable String file,
                                   @NotNull ContentWrapper wrapper,
                                   @NotNull final HttpServletResponse response) throws IOException {

    if (StringUtil.isEmptyOrSpaces(file)){
      return null;
    }

    final File includeFile = myConfig.mapIncludeFilePath(file);
    if (includeFile != null) {
      final char[] data;
      try {
        data = myCache.getContent(includeFile);
        wrapper.wrap(response, data);
      } catch (IOException e) {
        LOG.warn("Failed to open file to include: " + includeFile + ", error: " + e.toString());
        return sendError(response, "Failed to open file: " + includeFile.getName());
      }
    }

    if (includeFile == null || !includeFile.isFile()) {
      LOG.warn("Failed to open file to include: " + (includeFile != null ? includeFile : file) + ".");
      return sendError(response, "Path not found: " + file);
    }

    return null;
  }