CreateDir

// Create a directory; all ancestor directories must exist
boolean success = (new File("directoryName")).mkdir();
if (!success) {
    // Directory creation failed
}

// Create a directory; all non-existent ancestor directories are
// automatically created
success = (new File("directoryName")).mkdirs();
if (!success) {
    // Directory creation failed
}

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.