code: public static boolean resourceExists(String path, AbstractLaContainerBuilder builder) {
          InputStream is;
          try {
              is = builder.getResourceResolver().getInputStream(path);
          } catch (IORuntimeException ex) {
              if (ex.getCause() instanceof FileNotFoundException) {
                  return false;
              } else {
                  throw ex;
              }
          }
          if (is == null) {
              return false;
          } else {
              try {
                  is.close();
              } catch (IOException ignore) {}
              return true;
          }
      }
docs: =========