Lucene.Net.Util.LuceneTestCase.SlowFileExists C# (CSharp) Method

SlowFileExists() public static method

Returns true if the file exists (can be opened), false if it cannot be opened, and (unlike Java's File.exists) if there's some unexpected error.
public static SlowFileExists ( Directory dir, string fileName ) : bool
dir Directory
fileName string
return bool
        public static bool SlowFileExists(Directory dir, string fileName)
        {
            return dir.FileExists(fileName);
            /*try
            {
                dir.OpenInput(fileName, IOContext.DEFAULT).Dispose();
                return true;
            }
            catch (FileNotFoundException e)
            {
                return false;
            }*/
        }