Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6235357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:39:20+00:00 2026-05-24T10:39:20+00:00

I am downloading images using a imageAdapter extending a base class. Im storing them

  • 0

I am downloading images using a imageAdapter extending a base class. Im storing them in cache
here is where i test to see if they are in the cache

            URI imageUri = null;

            //Setting the Uri of aURL to imageUri.
            try {
            imageUri = aURL.toURI();

            } catch (URISyntaxException e1) {
            // TODO Auto-generated catch block
                e1.printStackTrace();
                        }



                //Testing to see if images are already in cache, if not then we load the images from the web and save them to the cache.
           if (new File(new File(myContext.getCacheDir(), "thumbnails"), "" + imageUri.hashCode()).exists())
                           {

        Log.v("Loader", "File exists in cache. Now pulling from the cache");

        String cachFile = myContext.getCacheDir() +"/thumbnails/"+imageUri.hashCode();
        FileInputStream fis;

My Question is how do i test this cache dir “thumbnails in another method in the application?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T10:39:21+00:00Added an answer on May 24, 2026 at 10:39 am

    To test that a file is in the cache directory or not, just use

    File f = new File("<path_to_your_file>");
    f.exists(); //TRUE if the file exists, FALSE otherwise.
    

    In your case, you can use the same code on other methods since myContext.getCacheDir() will return the same directory throughout the application.

    But, on the other methods, you still need to know imageUri to test.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm downloading around 200 images from url's using urlretrieve. They all download correctly except
I am downloading images using the NSURLConnection sendSynchronousRequest method and that works fine. However,
I was previously downloading images for my app by using dataWithContentsOfURL to download a
i am downloading tiff images from WAMP server using our Flex AIR client. Using
We are downloading web page linked Images, style sheet(.css) and javascript files using web
Here is the situation: I am displaying images on the map by using custom
I am using both GD and Curl(one or other) for downloading remote jpeg images
I am downloading images using NSOperationQueue. I want to call a method reloadView of
I'm having trouble downloading images using Clojure, there seems to be an issue with
i m parsing a json feed .using async image download I m downloading images

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.