> For the complete documentation index, see [llms.txt](https://jack80342.gitbook.io/spring-boot/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jack80342.gitbook.io/spring-boot/iv.-spring-boot-features/46.-creating-your-own-auto-configuration/46.3-condition-annotations/46.3.4-resource-conditions.md).

# 46.3.4 Resource条件

`@ConditionalOnResource`注解只在特定资源出现时才会包含配置，可以使用常见的Spring约定命名资源，例如`file:/home/user/test.dat`。
