code: public static String getResourceAsString(final String resourcePath) {
          File resource = getFileForResource(resourcePath);
  
          if (!resource.exists() || resource.isDirectory()) {
              logger.error("Cannot read resource, does not exist"
                      + " (or is a directory).");
              return "";
          }
  
          try {
              return FileUtils.readFileToString(resource);
          } catch (IOException ioe) {
              logger.error(ioe.getMessage());
              return "";
          }
      }
docs: Read the resource found at a specific path into a string.
  
  @param resourcePath The path to the resource.
  @return The resource as a string, or an empty string if the resource was
  not found.