I am using sonarqube 8.6 and I need to scan my project folder and need to check if the particular file is present in that folder or not. Can anyone help to get the idea how to implement any rules for such requirement.
IMO this should be implemented as a simple file.exists? check in your build pipeline.
Rules are for checking the contents of a source, not for file existence.