Here you can find the source of isReadableFile(final File f)
public static String isReadableFile(final File f)
//package com.java2s; // License as published by the Free Software Foundation; either import java.io.File; public class Main { public static String isReadableFile(final File f) { if (!f.exists()) { return "\"" + f + "\" does not exist"; }/*ww w .j a v a 2s. c o m*/ if (f.isDirectory()) { return "\"" + f + "\" is a directory"; } if (!f.isFile()) { return "\"" + f + "\" is not a file"; } if (!f.canRead()) { return "cannot read from \"" + f + "\""; } if (f.length() < 1) { return "\"" + f + "\" appears empty"; } return null; } }