Lucene.Net.Index.TestCompoundFile.CheckFiles C# (CSharp) Method

CheckFiles() private method

private CheckFiles ( Directory dir ) : void
dir Directory
return void
        private void CheckFiles(Directory dir)
        {
            foreach (string file in dir.ListAll())
            {
                if (file.EndsWith(IndexFileNames.COMPOUND_FILE_EXTENSION))
                {
                    CompoundFileDirectory cfsDir = new CompoundFileDirectory(dir, file, NewIOContext(Random()), false);
                    CheckFiles(cfsDir); // recurse into cfs
                    cfsDir.Dispose();
                }
                IndexInput @in = null;
                bool success = false;
                try
                {
                    @in = dir.OpenInput(file, NewIOContext(Random()));
                    success = true;
                }
                finally
                {
                    if (success)
                    {
                        IOUtils.Close(@in);
                    }
                    else
                    {
                        IOUtils.CloseWhileHandlingException(@in);
                    }
                }
            }
        }
    }