Android File Exist judgeFileExist(String p_sFilePath)

Here you can find the source of judgeFileExist(String p_sFilePath)

Description

Judge the given file exists or not

Parameter

Parameter Description
p_sFilePath a parameter

Return

boolean

Declaration

public static boolean judgeFileExist(String p_sFilePath) 

Method Source Code

//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;
    }
}

Related

  1. isFileExist(String folder, String fileName)
  2. isFileExist(String path)
  3. isFileExist(String path)
  4. isFileExist(String path, String fileName)
  5. isFileExist(String pathAndFileName)
  6. isExistFile(String name)
  7. isFileExists(String filename)
  8. isExist(String absPath)
  9. isExistFile(String name)