How to create a directory from a Java program?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   vani_hemmige
Posted On:   Monday, April 9, 2001 11:49 AM

Hi,
I am trying to create a directory from my Java program. Is there any way to do it? Please can you also tell me how to get a list of all files in a specified directory?
Thanks,
Vani

Re: How to create a directory from a Java program?

Posted By:   AlessandroA_Garbagnati  
Posted On:   Monday, April 9, 2001 12:32 PM

Hi,

Take a look at the java.io.File class.


To create a directory, just create a new File object, and then use mkdir() to create the physical directory.

To get a list of all the files in a specific directory, just create a new File object for that directory, and then use the list() or listFiles() method.
About | Sitemap | Contact