private String getETag(byte[] bytes) throws ServletException { try { byte[] digest = MessageDigest.getInstance("MD5").digest(bytes); return StringUtils.bytesToHex(digest); } catch (NoSuchAlgorithmException exception) { throw new ServletException("Could not create message digest.", exception); } }