home

=Creating directory using Java program!=

 The folder name contains a formatted date and name.

__Must have this imports!!!__

import java.io.File; import java.text.DateFormat; import java.util.Date;

__ The method for creating a folder using java programming eclipse. __

//public String createFolder(String folderName){ String strDirectoy = ""; Date now = new Date; try{ strDirectoy ="Absolute_Path"+DateFormat.getDateTimeInstance.format(now)+ ""+folderName+"";// Create one directory boolean success = (new File(strDirectoy)).mkdir; if (success) { System.out.println("Directory: " + strDirectoy + " created"); } } catch (Exception e){//Catch exception if any System.err.println("Error: " + e.getMessage); } return strDirectoy; }