Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Search for Folder contents on Java!!
Search for Folder contents on Java!! [message #447420] Tue, 14 December 2004 13:00 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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
>
>
Previous Topic:How can i place arbitrary controls in a table managed with a tableviewer ?
Next Topic:[ANN] v3.0 - SWT Designer, Swing Designer & WindowBuilder
Goto Forum:
  


Current Time: Sun Jul 06 03:52:43 EDT 2025

Powered by FUDForum. Page generated in 0.06369 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top