Java Directory Check checkDir(String path)

Here you can find the source of checkDir(String path)

Description

check Dir

License

Apache License

Declaration

private static void checkDir(String path) 

Method Source Code


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

import java.io.File;

public class Main {
    private static void checkDir(String path) {
        File dist = new File(path);
        if (dist.exists()) {
            if (!dist.isDirectory()) {
                dist.renameTo(new File(dist.getPath() + ".swp." + System.currentTimeMillis()));
                dist.mkdir();/* w ww.  j a va  2  s  . com*/
            }
        } else {
            dist.mkdir();
        }
    }
}

Related

  1. checkDir(String dir)
  2. checkDir(String dir, boolean mustWrite)
  3. checkDir(String directory)
  4. checkDir(String dirName)
  5. checkDir(String name)
  6. checkDir(String path)
  7. checkDir(String pDir)
  8. checkDirAndCreate(File dir)
  9. checkDirCopy(File srcDir, File destDir)