Java mkdir makeDir(File parentFile)

Here you can find the source of makeDir(File parentFile)

Description

make Dir

License

Open Source License

Declaration

public static void makeDir(File parentFile) 

Method Source Code

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

import java.io.File;

import java.util.Stack;

public class Main {

    public static void makeDir(File parentFile) {
        Stack<File> fileStack = new Stack<File>();

        while (!parentFile.exists()) {
            fileStack.push(parentFile);/*  w w w  .j  a va 2 s.  c  om*/
            parentFile = parentFile.getParentFile();
        }

        while (!fileStack.empty()) {
            File newFile = fileStack.pop();
            newFile.mkdir();
            newFile.setReadable(true, false);
            newFile.setWritable(true, true);
            newFile.setExecutable(true, true);
        }
    }
}

Related

  1. makeDir(File dir)
  2. makeDir(File f)
  3. makeDir(File file)
  4. makeDir(File file)
  5. makeDir(File parentDir, String dirName)
  6. makedir(String containerDir, String name)
  7. makeDir(String dir)
  8. makeDir(String dir)
  9. makeDir(String dir)