The Artima Developer Community
Sponsored Link

Java Answers Forum
Search File

3 replies on 1 page. Most recent reply: Feb 9, 2004 11:58 PM by mausam

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 3 replies on 1 page
shon

Posts: 42
Nickname: shon
Registered: Apr, 2003

Search File Posted: Feb 6, 2004 7:21 AM
Reply to this message Reply
Advertisement
can anyone have an idea or prototype to search file using java

input : time.exe

output : list result + path to open

Thank YOu urgent PLZ

I have figure for this for so long but still can't get


David Ramsey

Posts: 34
Nickname: dlramsey
Registered: Apr, 2002

Re: Search File Posted: Feb 6, 2004 12:31 PM
Reply to this message Reply
Please consult the Javadocs and study:

public File[] File.listFiles(FileFilter filter)

You should be able to build a recursive directory search program around that single method call, storing matches in some collection to be output later.

shon

Posts: 42
Nickname: shon
Registered: Apr, 2003

Re: Search File Posted: Feb 6, 2004 8:44 PM
Reply to this message Reply
I have study through this method , but if there is multiple drive in the system , how can i access it one by one?

mausam

Posts: 243
Nickname: mausam
Registered: Sep, 2003

Re: Search File Posted: Feb 9, 2004 11:58 PM
Reply to this message Reply
How abt this

File[] roots = File.listRoots();
for(int i=0;i<roots.length;i++)
    System.out.println("Root["+i+"]:" + roots[i]);
 
 


This will list the root directories

Flat View: This topic has 3 replies on 1 page
Topic: Deep Cloning Previous Topic   Next Topic Topic: call by value???

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use