Pages

Tuesday, March 16, 2010

Create a windows folder (in Java)

public void createFolder(String FolderPath)
    { 
        try{
            /* By default the folders will be created in your workspace directory
             * Hence it is advisable to provide a proper path where you can find these directories easily
             */
            (new java.io.File(FolderPath)).mkdirs();
               
        }catch (Exception e){//Catch exception if any
            e.printStackTrace();
        }
    }//END OF createFolder

No comments:

Post a Comment