Java Path Create makePath(File copyTo)

Here you can find the source of makePath(File copyTo)

Description

make Path

License

Open Source License

Declaration

public static void makePath(File copyTo) throws IOException 

Method Source Code

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

import java.io.File;

import java.io.IOException;

public class Main {
    public static void makePath(File copyTo) throws IOException {
        File p = copyTo.getParentFile();
        if (p == null) {
            return;
        }/*from w ww .j av  a2s .  c  om*/
        if (!p.exists()) {
            if (!p.mkdirs()) {
                throw new IOException("Could not create directory: " + p.getAbsolutePath());
            }
        }
    }
}

Related

  1. makePath(Collection files)
  2. makePath(File cwd, String path)
  3. makePath(final String dir, final String... jars)
  4. makePath(String basePath)
  5. makePath(String filename, String savePath)