Java Create Directory mkdirs(String packageName, File root)

Here you can find the source of mkdirs(String packageName, File root)

Description

mkdirs

License

Open Source License

Declaration

public static File mkdirs(String packageName, File root) 

Method Source Code


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

public class Main {
    public static File mkdirs(String packageName, File root) {
        String[] dirs = packageName.split("\\.");

        for (String dir : dirs) {
            File f = new File(root, dir);

            if (!f.exists()) {
                f.mkdir();/*from ww w  .ja v  a2 s  . c  o m*/
            }

            root = f;
        }

        return root;
    }
}

Related

  1. mkdirs(String fileName, String baseName)
  2. mkdirs(String filePath)
  3. mkdirs(String filePath)
  4. mkDirs(String filePath)
  5. mkdirs(String name)
  6. mkdirs(String parentName, String childName)
  7. mkDirs(String path)
  8. mkdirs(String path)
  9. mkdirs(String path, boolean deleteBeforeCreate)