Re: Search for a file on hard drive?
Mike Cronin <[email protected]>
| Newsgroups | gmane.comp.java.sun.servlet |
|---|---|
| Message-ID | <[email protected]> |
Should be as simple as doing the following...
File file = new File("C:\\");
String [] files = file.list();
for (int i=0; i<files.length; i++) {
if (files[i].endsWith(".exe")) {
System.out.println(files[i]);
}
}
Hope that's what you're looking for.
Mike
-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[email protected]] On Behalf Of Ali
Chadorbaf
Sent: Wednesday, April 16, 2003 8:35 AM
To: [email protected]
Subject: Search for a file on hard drive?
Hi,
Any method available to search for a group of file(e.g : *.exe) on
server and
return the names of those files, if any?
Thanks.
__________________________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo
http://search.yahoo.com
________________________________________________________________________
___
To unsubscribe, send email to [email protected] and include in the
body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html