Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.os.StatFs;

import java.io.File;

public class Main {

    public static boolean isDirectoryValid(String path) {
        File file = new File(path);
        if (!file.canWrite()) {
            return false;
        }
        StatFs sf = new StatFs(file.getPath());
        long availCount = sf.getAvailableBlocks();
        if (availCount > 0) {
            return true;
        }
        return false;
    }
}