Android Directory Create mkdir(String filePath)

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

Description

mkdir

Declaration

public static void mkdir(String filePath) 

Method Source Code

//package com.java2s;
import java.io.File;

public class Main {

    public static void mkdir(String filePath) {
        StringBuffer path = new StringBuffer();
        String[] fileList = filePath.split("/");

        path.append(fileList[0]);//from   w  w w  .  ja  v a  2  s . co m
        File rootfile = new File(path.toString());
        rootfile.mkdir();

        for (int i = 1; i < fileList.length; i++) {
            path.append("/").append(fileList[i]);
            File file = new File(path.toString());
            file.mkdir();
        }
    }
}

Related

  1. makeDirs(File f)
  2. makehome(String home)
  3. mkDir(String dirName)
  4. mkDir(String path)
  5. mkdir(File path)
  6. mkdir(String path)
  7. mkdir(String s)
  8. mkdirs(String pathName)
  9. mkdirs(String pathName)