Here you can find the source of isFileExist(String sFileName)
Parameter | Description |
---|---|
sFileName | File Name |
public static boolean isFileExist(String sFileName)
//package com.java2s; //License from project: Apache License import java.io.File; public class Main { /**//from w ww.j a v a 2 s .c om * File exist check * * @param sFileName File Name * @return boolean true - exist<br> * false - not exist */ public static boolean isFileExist(String sFileName) { boolean result = false; try { File f = new File(sFileName); //if (f.exists() && f.isFile() && f.canRead()) { if (f.exists() && f.isFile()) { result = true; } else { result = false; } } catch (Exception e) { result = false; } /* return */ return result; } }