Home / Function/ getResource() — spring-boot Function Reference

getResource() — spring-boot Function Reference

Architecture documentation for the getResource() function in ApplicationResourceLoader.java from the spring-boot codebase.

Function java GradlePlugin AotProcessing calls 3 called by 14

Entity Profile

Dependency Diagram

graph TD
  5ea8357e_a689_1ed1_dd1d_d85bc3ac4c59["getResource()"]
  7751f819_e7fd_c2a2_dfa6_a4b065b8aec5["getResource()"]
  7751f819_e7fd_c2a2_dfa6_a4b065b8aec5 -->|calls| 5ea8357e_a689_1ed1_dd1d_d85bc3ac4c59
  7ff38b43_3fd3_7b86_ff64_fd813bdc27d4["loadConfiguration()"]
  7ff38b43_3fd3_7b86_ff64_fd813bdc27d4 -->|calls| 5ea8357e_a689_1ed1_dd1d_d85bc3ac4c59
  1713cec4_0f07_a26a_cf7f_ab9b57549a5a["load()"]
  1713cec4_0f07_a26a_cf7f_ab9b57549a5a -->|calls| 5ea8357e_a689_1ed1_dd1d_d85bc3ac4c59
  5ba3f868_a29c_7e6a_f220_04c9036b258c["loadOverride()"]
  5ba3f868_a29c_7e6a_f220_04c9036b258c -->|calls| 5ea8357e_a689_1ed1_dd1d_d85bc3ac4c59
  cafc9a8c_e23a_b8c4_5c44_2f02f0d89617["loadConfiguration()"]
  cafc9a8c_e23a_b8c4_5c44_2f02f0d89617 -->|calls| 5ea8357e_a689_1ed1_dd1d_d85bc3ac4c59
  af603f20_f717_e927_d5c1_b4e3034da10b["loadKeyStore()"]
  af603f20_f717_e927_d5c1_b4e3034da10b -->|calls| 5ea8357e_a689_1ed1_dd1d_d85bc3ac4c59
  85d0aa6e_c0cb_cb5b_66d9_611455885afb["encodeFileContent()"]
  85d0aa6e_c0cb_cb5b_66d9_611455885afb -->|calls| 5ea8357e_a689_1ed1_dd1d_d85bc3ac4c59
  bcc33cd2_794d_6be9_56df_398bfe786b5e["usesResourceLoader()"]
  bcc33cd2_794d_6be9_56df_398bfe786b5e -->|calls| 5ea8357e_a689_1ed1_dd1d_d85bc3ac4c59
  9b2986dd_1d7f_b334_075c_50def21eed1e["loadWithResourceLoaderUsesResourceLoader()"]
  9b2986dd_1d7f_b334_075c_50def21eed1e -->|calls| 5ea8357e_a689_1ed1_dd1d_d85bc3ac4c59
  60046256_a8af_87c4_c7c7_d6a98f5b5b19["getResourceWhenFilteredReactiveWebContextResourceWithPreferFileResolution()"]
  60046256_a8af_87c4_c7c7_d6a98f5b5b19 -->|calls| 5ea8357e_a689_1ed1_dd1d_d85bc3ac4c59
  5d491407_dc50_213f_86f2_1249840fabae["getResourceWhenFilteredReactiveWebContextResource()"]
  5d491407_dc50_213f_86f2_1249840fabae -->|calls| 5ea8357e_a689_1ed1_dd1d_d85bc3ac4c59
  3ed4a1bf_4a21_e1f7_8d42_3b145cf1b3d6["getResourceWithPreferFileResolutionWhenPathWithServletContextResource()"]
  3ed4a1bf_4a21_e1f7_8d42_3b145cf1b3d6 -->|calls| 5ea8357e_a689_1ed1_dd1d_d85bc3ac4c59
  961a3123_c606_d74d_00d4_c02217be8dda["toWatchPathWhenPathReturnsPath()"]
  961a3123_c606_d74d_00d4_c02217be8dda -->|calls| 5ea8357e_a689_1ed1_dd1d_d85bc3ac4c59
  d5676191_95e3_a3cd_6e0d_4a13b4f6656d["toWatchPathUsesResourceLoader()"]
  d5676191_95e3_a3cd_6e0d_4a13b4f6656d -->|calls| 5ea8357e_a689_1ed1_dd1d_d85bc3ac4c59
  style 5ea8357e_a689_1ed1_dd1d_d85bc3ac4c59 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

core/spring-boot/src/main/java/org/springframework/boot/io/ApplicationResourceLoader.java lines 291–304

		@Override
		public Resource getResource(String location) {
			if (StringUtils.hasLength(location)) {
				for (ProtocolResolver protocolResolver : this.protocolResolvers) {
					Resource resource = protocolResolver.resolve(location, this);
					if (resource != null) {
						return resource;
					}
				}
			}
			Resource resource = this.resourceLoader.getResource(location);
			String filePath = getFilePath(location, resource);
			return (filePath != null) ? new ApplicationResource(filePath) : resource;
		}

Domain

Subdomains

Called By

Frequently Asked Questions

What does getResource() do?
getResource() is a function in the spring-boot codebase.
What does getResource() call?
getResource() calls 3 function(s): ApplicationResource, getFilePath, getResource.
What calls getResource()?
getResource() is called by 14 function(s): encodeFileContent, getResource, getResourceWhenFilteredReactiveWebContextResource, getResourceWhenFilteredReactiveWebContextResourceWithPreferFileResolution, getResourceWithPreferFileResolutionWhenPathWithServletContextResource, load, loadConfiguration, loadConfiguration, and 6 more.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free