<p dir="auto">Hi,now I want to migrate my app from universalimageloader to glide. But I have a question is that I can‘t judge a image is already cached in disk。</p>
<p dir="auto">There is my case:<br>
There are many different resources and different URL for one image. Different network environments load different resources。For example，When I was in the 3G network，load the low quality image resource and the URL is "http://www.xxxxx_3g.png"。When I was in the WIFI network，load the high quality image resource and the URL is "http://www.yyyyyy_wifi.png"，There are two different URLs。</p>
<p dir="auto">BUT! When I was in the 3G network，check the  high quality image resource first。If the high quality image resource is already cached, load the  high quality image resource URL from disk cache. Otherwise  load "http://www.xxxxx_3g.png"。</p>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="if (isCache(&quot;http://www.yyyyyy_wifi.png&quot;) {
    Glide.with(...)
        .load(&quot;http://www.yyyyyy_wifi.png&quot;)
        .into(...);
} else {
    Glide.with(...)
        .load(&quot;http://www.xxxxx_3g.png&quot;)
        .into(...);
}

public boolean isCache(String url) {
    // what should I do ???
}"><pre class="notranslate"><span class="pl-k">if</span> (<span class="pl-en">isCache</span>(<span class="pl-s">"http://www.yyyyyy_wifi.png"</span>) {
    <span class="pl-smi">Glide</span>.<span class="pl-en">with</span>(...)
        .<span class="pl-en">load</span>(<span class="pl-s">"http://www.yyyyyy_wifi.png"</span>)
        .<span class="pl-en">into</span>(...);
} <span class="pl-k">else</span> {
    <span class="pl-smi">Glide</span>.<span class="pl-en">with</span>(...)
        .<span class="pl-en">load</span>(<span class="pl-s">"http://www.xxxxx_3g.png"</span>)
        .<span class="pl-en">into</span>(...);
}

<span class="pl-k">public</span> <span class="pl-smi">boolean</span> <span class="pl-s1">isCache</span>(<span class="pl-smi">String</span> <span class="pl-s1">url</span>) {
    <span class="pl-c">// what should I do ???</span>
}</pre></div>
<p dir="auto">So,How can I judge the high quality image resource(URL is "http://www.yyyyyy_wifi.png") is already cached in disk synchronously?</p>
<p dir="auto">Thank you very much。</p>
<p dir="auto">I am new in glide and want to migrate my app from universalimageloader to glide.<br>
I want to convert cached image from the disk into image file, and show it into an ImageView.</p>
<p dir="auto">When I use universalimageloader, I can do it easily with this way:</p>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="File imageFile = DiskCacheUtils.findInCache(image_url,  ImageLoader.getInstance().getDiscCache());
//then show it into image view
String file_target = &quot;file://&quot;+imageFile.getPath();
ImageLoader.getInstance().displayImage(target, imageView);"><pre class="notranslate"><span class="pl-smi">File</span> <span class="pl-s1">imageFile</span> = <span class="pl-smi">DiskCacheUtils</span>.<span class="pl-en">findInCache</span>(<span class="pl-s1">image_url</span>,  <span class="pl-smi">ImageLoader</span>.<span class="pl-en">getInstance</span>().<span class="pl-en">getDiscCache</span>());
<span class="pl-c">//then show it into image view</span>
<span class="pl-smi">String</span> <span class="pl-s1">file_target</span> = <span class="pl-s">"file://"</span>+<span class="pl-s1">imageFile</span>.<span class="pl-en">getPath</span>();
<span class="pl-smi">ImageLoader</span>.<span class="pl-en">getInstance</span>().<span class="pl-en">displayImage</span>(<span class="pl-s1">target</span>, <span class="pl-s1">imageView</span>);</pre></div>
<p dir="auto">However I have not found a way from documentation to do that in Glide.</p>
<p dir="auto">Is it possible?</p>