Solved

Scan local drives for images

Posted on 2007-04-04
2
164 Views
Last Modified: 2010-03-31
Can anyone give me some clues on how to scan local drives for images?
0
Comment
Question by:khoama
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 11

Accepted Solution

by:
elfe69 earned 500 total points
ID: 18848943
Here is an example of deep directory scanning:
http://www.exampledepot.com/egs/java.io/TraverseTree.html

You could adapt that code to select only the files with the extensions you want
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 18849004
http://www.exampledepot.com/egs/java.io/GetFiles.html


FileFilter fileFilter = new FileFilter() {

      final String[] IMAGE_EXTENSIONS = { ".jpeg", ".jpg", ".png", ".gif" };
      
       
        public boolean accept(File file) {
              boolean isImage = false;
              String name = file.getName().toLowerCase();
              for(int i = 0;i < IMAGE_EXTENSIONS.length && isImage == false;i++) {
              isImage = name.endsWith(IMAGE_EXTENSIONS[i]);
            }
            return isImage;
        }
       
};

0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question