@Override
    public InputStream getInputStream() throws ResourceIOException {
        final File file = this.fileRef.get();
        if (file != null) {
            try {
                return new FileInputStream(file);
            } catch (final FileNotFoundException ex) {
                throw new ResourceIOException(ex.getMessage(), ex);
            }
        }
        throw new ResourceIOException("Resource already disposed");
    }
Cache resource backed by a file.

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