I have a piece of code below that uses the console to prompt the user for a complete path to an input file. No matter what I do with regex I can't get the full path to be assigned to a string such that File can use it to check for the file's existence. Further below is the method that attempts to do the actual check. It always returns false no matter what I do.

Note that I'm expecting a windows path as the input from the user "c:\some\path\file", NOT "c:\\some\\path\\file".


BufferedReader bufr = new BufferedReader(new InputStreamReader(System.in));
String strInput;

System.out.print("\nEnter full path to database: ");
strInput = bufr.readLine();

if(setSource(strInput) == false) //source database invalid?
{
System.out.println("\nInvalid database\n");
return; // exit program
}



private boolean setSource(String pStr)
{
String strTemp = pStr.replaceAll("\\\\", "\\\\\\\\");
File filTemp = new File(strTemp);

if(filTemp.exists())
{
return true;
}
else
{
return false;
}
}