File目录和file文件的创建

File path = new File("/sdcard/okc");
        File file = new File("/sdcard/okc/save.txt");
        if (!path.exists()){
            path.mkdirs();
        }
        if (!file.exists()){
            file.createNewFile();
        }
原文地址:https://www.cnblogs.com/tiejiangweigaibianercunzai/p/3901822.html