Java Utililty Methods Directory Create

List of utility methods to do Directory Create

Description

The list of methods to do Directory Create are organized into topic(s).

Method

booleanmkdir(File d)
creates directory if it does not exist and returns true if exists now
d.mkdir();
return d.isDirectory();
voidmkdir(File dir)
mkdir
if (dir.exists()) {
    if (!dir.isDirectory()) {
        dir.delete();
        dir.mkdir();
} else {
    mkdir(dir.getParentFile());
    dir.mkdir();
...
voidmkdir(File dir)
Creates the given directory.
if (!dir.exists() || !dir.isDirectory()) {
    if (!dir.mkdir()) {
        throw new IOException("Failed to create directory " + dir);
voidmkDir(File dir)
mk Dir
if (dir.isDirectory())
    return;
if (!dir.mkdir())
    throw new IOException("Failed to create directory \"" + dir.getAbsolutePath() + "\"");
voidmkdir(File dir)
mkdir
if (dir.isFile()) {
    throw new Exception("Can't create directory, file exists " + dir);
if (!dir.exists() && !dir.mkdirs()) {
    throw new Exception("Failed creating directory " + dir);
voidmkdir(File dir)
mkdir
if (dir.exists()) {
    if (!dir.isDirectory()) {
        throw new IllegalArgumentException("specified path is already exists,"
                + " and not a directory. path=[" + dir.getAbsolutePath() + "]");
} else if (!dir.mkdirs()) {
    throw new RuntimeException("failed to create directory. path=[" + dir + "]");
voidmkdir(File dir)
CreatingUtils single folders.
if (dir.exists()) {
    if (dir.isDirectory() == false) {
        throw new IOException("Destination '" + "' is not a directory.");
    return;
if (dir.mkdir() == false) {
    throw new IOException("Unable to create directory '" + dir + "'.");
...
voidmkdir(File dir)
Creates the given directory.
if (!dir.exists() || !dir.isDirectory()) {
    if (!dir.mkdir()) {
        throw new IOException("Failed to create directory " + dir);
voidmkDir(File dir)
mk Dir
if (dir == null) {
    throw new RuntimeException("dir attribute is required");
if (dir.isFile()) {
    throw new RuntimeException("Unable to create directory as a file " + "already exists with that name: "
            + dir.getAbsolutePath());
if (!dir.exists()) {
...
voidmkdir(File dir)
CreatingUtils single folders.
if (dir.exists()) {
    if (dir.isDirectory() == false) {
        throw new IOException("Destination '" + "' is not a directory.");
    return;
if (!dir.mkdir() && !dir.mkdirs()) {
    throw new IOException("Unable to create directory '" + dir + "'.");
...