Here you can find the source of createDir(final File path)
Parameter | Description |
---|---|
path | directory to create |
public static boolean createDir(final File path)
import java.io.File; import java.io.IOException; import org.apache.log4j.Logger; public class Main{ private static final Logger logger = Logger.getLogger(FileUtil.class); /**//from w w w .jav a2s . co m * Makes a directory, including any necessary but nonexistent parent directories. * * @param path * directory to create * @return true if the directory has been created successfully */ public static boolean createDir(final File path) { boolean isSuccess = false; if (path != null) { try { org.apache.commons.io.FileUtils.forceMkdir(path); isSuccess = true; } catch (IOException e) { logger.warn(e, e); } } else { logger.warn("Oops!.. Path is null!"); } return isSuccess; } }