Android Directory Check checkDirectory(String dir)

Here you can find the source of checkDirectory(String dir)

Description

check Directory

Declaration

private static boolean checkDirectory(String dir) 

Method Source Code

//package com.java2s;

import java.io.File;

public class Main {
    private static boolean checkDirectory(String dir) {
        File dirObj = new File(dir);
        if (dirObj.exists()) {
            if (!dirObj.isDirectory()) {
                dirObj.delete();//from   ww w  . ja v  a 2s .  co  m
            }
            return false;
        }
        if (!dirObj.exists()) {
            dirObj.mkdirs();
        }
        return true;
    }
}

Related

  1. checkDirectory(String directory)