Java Create Directory mkdirsOrCrash(File d)

Here you can find the source of mkdirsOrCrash(File d)

Description

mkdirs Or Crash

License

Open Source License

Declaration

public static void mkdirsOrCrash(File d) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.File;

public class Main {
    public static void mkdirsOrCrash(File d) {
        if (!d.exists())
            d.mkdirs();/*w w  w  . j a  v a 2 s.co  m*/
        if (!d.isDirectory())
            throw new RuntimeException("\"" + d.getAbsolutePath() + "\" must be a directory. Aborting.");
    }
}

Related

  1. mkdirsFor(File destination)
  2. mkdirsIfAbsent(String pathname)
  3. mkdirsIfNotExists(String pathname)
  4. mkdirsifnotExists(String s)
  5. mkdirsInRemote(String host, String path, boolean deleteIfExisted)
  6. mkdirsOrFail(File dirFile)
  7. mkdirsWithExistsCheck(File dir)
  8. mkdirsWithRetry(final File f)