code: public static boolean doesResourceExist(final Resource res) {
          if (res != null) {
              try {
                  IOUtils.read(res.getInputStream(), new byte[1]);
                  return res.contentLength() > 0;
              } catch (final FileNotFoundException e) {
                  LOGGER.trace(e.getMessage());
                  return false;
              } catch (final Exception e) {
                  LOGGER.trace(e.getMessage(), e);
                  return false;
              }
          }
          return false;
      }
docs: Does resource exist?
  
  @param res the res
  @return the boolean