Java mkdir makeDirs(String fileName)

Here you can find the source of makeDirs(String fileName)

Description

make Dirs

License

Apache License

Declaration

public static boolean makeDirs(String fileName) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.io.File;

public class Main {
    public static boolean makeDirs(String fileName) {
        if (fileName == null || fileName.isEmpty()) {
            return false;
        }//  w w w  . j a v  a2 s.c om
        String filePath = fileName.substring(0, fileName.lastIndexOf("/"));
        File folder = new File(filePath);
        return (folder.exists() && folder.isDirectory()) ? true : folder.mkdirs();
    }
}

Related

  1. makeDirs(File dir, int numTries)
  2. makeDirs(File f)
  3. makeDirs(File file)
  4. makeDirs(final File file)
  5. makeDirs(String dir)
  6. makedirs(String fileName)
  7. makeDirs(String fileName, boolean hasFile)
  8. makeDirs(String filePath)
  9. makeDirs(String strBottomFoldName, String strFoldName)