Here you can find the source of isReadable(String filename)
Parameter | Description |
---|---|
filename | The file to check. |
public static boolean isReadable(String filename)
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); import java.io.File; public class Main { /**//from ww w . j a v a 2 s . c om * Determine if the given filename exists and is readable. * @param filename The file to check. * @return true if the file exists and is readable. If the filename is null, * then false is returned. */ public static boolean isReadable(String filename) { if (filename == null) { return false; } File file = new File(filename); return file.exists() && file.canRead(); } }