Java Utililty Methods Directory Create

List of utility methods to do Directory Create

  1. HOME
  2. Java
  3. D
  4. Directory Create

Description

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

Method

boolean mkdir(File d)
creates directory if it does not exist and returns true if exists now
d.mkdir();
return d.isDirectory();
void mkdir(File dir)
mkdir
if (dir.exists()) {
 if (!dir.isDirectory()) {
 dir.delete();
 dir.mkdir();
} else {
 mkdir(dir.getParentFile());
 dir.mkdir();
...
void mkdir(File dir)
Creates the given directory.
if (!dir.exists() || !dir.isDirectory()) {
 if (!dir.mkdir()) {
 throw new IOException("Failed to create directory " + dir);
void mkDir(File dir)
mk Dir
if (dir.isDirectory())
 return;
if (!dir.mkdir())
 throw new IOException("Failed to create directory \"" + dir.getAbsolutePath() + "\"");
void mkdir(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);
void mkdir(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 + "]");
void mkdir(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 + "'.");
...
void mkdir(File dir)
Creates the given directory.
if (!dir.exists() || !dir.isDirectory()) {
 if (!dir.mkdir()) {
 throw new IOException("Failed to create directory " + dir);
void mkDir(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()) {
...
void mkdir(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 + "'.");
...


AltStyle によって変換されたページ (->オリジナル) /