public EntityBuilder setFile(final File file) {
        clearContent();
        this.file = file;
        return this;
    }
Sets entity content as a {@link File}. This method is mutually exclusive with
{@link #setText(String)},
{@link #setBinary(byte[])},
{@link #setStream(java.io.InputStream)},
{@link #setParameters(java.util.List)},
{@link #setParameters(NameValuePair...)}
{@link #setSerializable(java.io.Serializable)}.

@param file entity content as a {@link File}.
@return this instance.
httpclient5/src/main/java/org/apache/hc/client5/http/entity/EntityBuilder.java