Here you can find the source of judgeFileExist(String p_sFilePath)
Judge the given file exists or not
Parameter | Description |
---|---|
p_sFilePath | a parameter |
public static boolean judgeFileExist(String p_sFilePath)
//package com.java2s; import java.io.File; public class Main { /**/*from w w w . j a v a 2 s .c o m*/ * <p>Judge the given file exists or not</p> * @param p_sFilePath * @return boolean */ public static boolean judgeFileExist(String p_sFilePath) { boolean t_sIsExist = false; File t_TmpFile = null; try { t_TmpFile = new File(p_sFilePath); if (t_TmpFile.exists()) { t_sIsExist = true; } else { t_sIsExist = false; } } catch (Exception e) { t_sIsExist = false; return t_sIsExist; } return t_sIsExist; } }