Search for Folder contents on Java!! [message #447420] |
Tue, 14 December 2004 13:00  |
Eclipse User |
|
|
|
Originally posted by: mohamed_badr.yahoo.com
Hi all,
Sorry for the stupid question again, I just moved from C++ programming to
Java programming and still missing a lot.
I have a folder path and I want to enumerate its contents, in C++ I used to
have CFileFind. How can I do that for Java ??
Thanks
|
|
|
Re: Search for Folder contents on Java!! [message #447562 is a reply to message #447420] |
Tue, 14 December 2004 14:34  |
Eclipse User |
|
|
|
1- The following code would output a list of the files in a directory:
File f = new File(folderPath);
File[] contents = f.listFiles();
for (int i=0; i<contents.length; i++)
System.out.println(contents[i].getName());
for more info, see the documentation for: java.io.File
2- This forum is ONLY for issues related to SWT.
For general question about the java programming language, please use the
java technology forums in the future:
http://forum.java.sun.com
regards,
Mani
"msnews.microsoft.com" <mohamed_badr@yahoo.com> wrote in message
news:cpn9lu$i4f$1@www.eclipse.org...
> Hi all,
> Sorry for the stupid question again, I just moved from C++ programming to
> Java programming and still missing a lot.
>
> I have a folder path and I want to enumerate its contents, in C++ I used
> to
> have CFileFind. How can I do that for Java ??
> Thanks
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.06369 seconds