Java Create Directory mkdir(String mkdirName)

Here you can find the source of mkdir(String mkdirName)

Description

mkdir

License

Apache License

Declaration

public static boolean mkdir(String mkdirName) 

Method Source Code

//package com.java2s;
/**//w  ww .  ja  va2 s.  co  m
  *  Copyright (c) 2014 http://www.lushapp.wang
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  */

import java.io.*;

public class Main {
    public static boolean mkdir(String mkdirName) {
        try {
            File dirFile = new File(mkdirName);
            boolean bFile = dirFile.exists();
            if (bFile) {
                return true;
            } else {
                bFile = dirFile.mkdir();
                return bFile;
            }
        } catch (Exception err) {
            return false;
        }
    }
}

Related

  1. mkdir(String dname)
  2. mkdir(String folder)
  3. mkdir(String folderName, long lastModifiedDate)
  4. mkdir(String folderpath)
  5. mkDir(String fullPath, String directoryPath)
  6. mkdir(String name)
  7. mkdir(String name)
  8. mkdir(String name, File dir)
  9. mkdir(String path)