static String generateUniqueCacheFileName(final String requestId, final String eTag, final byte[] content, final int off, final int len) {
        final StringBuilder buf = new StringBuilder();
        if (eTag != null) {
            PercentCodec.RFC3986.encode(buf, eTag);
            buf.append('@');
        } else if (content != null) {
            final MessageDigest sha256;
            try {
                sha256 = MessageDigest.getInstance("SHA-256");
            } catch (final NoSuchAlgorithmException ex) {
                throw new IllegalStateException(ex);
            }
            sha256.update(content, off, len);
            buf.append(TextUtils.toHexString(sha256.digest()));
            buf.append('@');
        }
        PercentCodec.RFC3986.encode(buf, requestId);
        return buf.toString();
    }
Generates {@link Resource} instances whose body is stored in a temporary file.

@since 4.1
httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/FileResourceFactory.java