Java Is Readable File isReadableFile(File path)

Here you can find the source of isReadableFile(File path)

Description

Returns true if the specified path represents a readable file, false otherwise.

License

MIT License

Parameter

Parameter Description
path a file path.

Return

true if the specified path represents a readable file, false otherwise.

Declaration

public static boolean isReadableFile(File path) 

Method Source Code


//package com.java2s;
/*//from   ww w  .  ja v  a2s  . c  o  m
 * Copyright (c) 2015-2016 QuartzDesk.com.
 * Licensed under the MIT license (https://opensource.org/licenses/MIT).
 */

import java.io.File;

public class Main {
    /**
     * Returns true if the specified path represents a readable file, false otherwise.
     *
     * @param path a file path.
     * @return true if the specified path represents a readable file, false otherwise.
     */
    public static boolean isReadableFile(File path) {
        return path.isFile() && path.canRead();
    }
}

Related

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