Java tutorial
//package com.java2s; //License from project: Apache License import java.io.File; public class Main { static boolean isFileUseful(File file) { return file != null && file.exists() && file.canRead() && !file.isDirectory(); } }