how to check if file exists and open it?
if(file is found)
{
FileInputStream file = new FileInputStream("file");
}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
File.isFilewill tell you that a file exists and is not a directory.Note, that the file could be deleted between your check and your attempt to open it, and that method does not check that the current user has read permissions.