Java Is Readable File isReadableFile(final String filename)

Here you can find the source of isReadableFile(final String filename)

Description

is Readable File

License

BSD License

Parameter

Parameter Description
filename a parameter

Declaration

public static boolean isReadableFile(final String filename) 

Method Source Code

//package com.java2s;
/*--------------------------------------------------------
 * Copyright (c) 2011, The Dojo Foundation
 * This software is distributed under the "Simplified BSD license",
 * the text of which is available at http://www.winktoolkit.org/licence.txt
 * or see the "license.txt" file for more details.
 *--------------------------------------------------------*/

import java.io.File;

public class Main {
    /**//from  ww  w  .j av  a  2 s  .  com
     * @param filename
     * @return
     */
    public static boolean isReadableFile(final String filename) {
        // System.out.println("isReadableFile: " + filename);
        final File f = new File(filename);
        if (f.exists() && f.isFile() && f.canRead()) {
            return true;
        }
        return false;
    }
}

Related

  1. isReadableFile(File file)
  2. isReadableFile(File file)
  3. isReadableFile(File file)
  4. isReadableFile(File path)
  5. isReadableFile(final File f)
  6. isReadableFile(String fileName)