class Files {

    public static String checkFile(final File file, final boolean checkWrite) {
        if (file == null)
            throw new IllegalArgumentException(NULL_PARAMS);
        
        if (!file.exists())
            return String.format(FILE_NO_EXIST, file);
        if (file.isDirectory())
            return String.format(DIR_NOT_FILE, file);
        if (!file.canRead())
            return String.format(FILE_NOT_READABLE, file);
        if (checkWrite && !file.canWrite())
            return String.format(FILE_NOT_WRITABLE, file);
        
        return null;
    }

}