Code example for File

Methods: delete, getParentFile, listFiles

0
            AppLogger.d("this device dont have wifi network, clear cache task stop"); 
        } 
    } 
 
    private void clearEmptyDir(File file) {
        File[] fileArray = file.listFiles();
        if (fileArray == null)
            return; 
 
        if (fileArray.length == 0) {
            if (file.delete()) {
                clearEmptyDir(file.getParentFile());
            } 
        } 
    } 
 
    private void handleDir(File file) {
        File[] fileArray = file.listFiles();
        if (fileArray != null) {
            if (fileArray.length != 0) {
                for (File fileSI : fileArray) {