# Uses of Interface
org.springframework.core.io.Resource

Packages that use Resource
Package
Description
org.springframework.aot.hint
Support for registering the need for reflection, resources, java serialization and proxies at runtime.
org.springframework.core.codec
`Encoder` and `Decoder` abstractions to convert between a reactive stream of bytes and Java objects.
org.springframework.core.io
Generic abstraction for (file-based) resources, used throughout the framework.
org.springframework.core.io.buffer
Generic abstraction for working with byte buffer implementations.
org.springframework.core.io.support
Support classes for Spring's resource abstraction.
org.springframework.core.type.classreading
Support classes for reading annotation and class-level metadata.

## Uses of Resource in org.springframework.aot.hint

Methods in org.springframework.aot.hint with parameters of type Resource
Modifier and Type
Method
Description
`void`
ResourceHints.`registerResource(Resource resource)`
Register that the supplied resource should be made available at runtime.

## Uses of Resource in org.springframework.core.codec

Methods in org.springframework.core.codec that return Resource
Modifier and Type
Method
Description
`Resource`
ResourceDecoder.`decode(DataBuffer dataBuffer, ResolvableType elementType, MimeType mimeType, Map<String,Object> hints)`
Methods in org.springframework.core.codec that return types with arguments of type Resource
Modifier and Type
Method
Description
`reactor.core.publisher.Flux<Resource>`
ResourceDecoder.`decode(Publisher<DataBuffer> inputStream, ResolvableType elementType, MimeType mimeType, Map<String,Object> hints)`
Methods in org.springframework.core.codec with parameters of type Resource
Modifier and Type
Method
Description
`protected reactor.core.publisher.Flux<DataBuffer>`
ResourceEncoder.`encode(Resource resource, DataBufferFactory bufferFactory, ResolvableType type, MimeType mimeType, Map<String,Object> hints)`

## Uses of Resource in org.springframework.core.io

Subinterfaces of Resource in org.springframework.core.io
Modifier and Type
Interface
Description
`interface`
`ContextResource`
Extended interface for a resource that is loaded from an enclosing 'context', for example, from a `jakarta.servlet.ServletContext` but also from plain classpath paths or relative file system paths (specified without an explicit prefix, hence applying relative to the local `ResourceLoader`'s context).
`interface`
`WritableResource`
Extended interface for a resource that supports writing to it.
Classes in org.springframework.core.io that implement Resource
Modifier and Type
Class
Description
`class`
`AbstractFileResolvingResource`
Abstract base class for resources which resolve URLs into File references, such as `UrlResource` or `ClassPathResource`.
`class`
`AbstractResource`
Convenience base class for `Resource` implementations, pre-implementing typical behavior.
`class`
`ByteArrayResource`
`Resource` implementation for a given byte array.
`class`
`ClassPathResource`
`Resource` implementation for class path resources.
`protected static class`
`DefaultResourceLoader.ClassPathContextResource`
ClassPathResource that explicitly expresses a context-relative path through implementing the ContextResource interface.
`class`
`DescriptiveResource`
Simple `Resource` implementation that holds a resource description but does not point to an actually readable resource.
`class`
`FileSystemResource`
`Resource` implementation for `java.io.File` and `java.nio.file.Path` handles with a file system target.
`class`
`FileUrlResource`
Subclass of `UrlResource` which assumes file resolution, to the degree of implementing the `WritableResource` interface for it.
`class`
`InputStreamResource`
`Resource` implementation for a given `InputStream` or a given `InputStreamSource` (which can be supplied as a lambda expression) for a lazy `InputStream` on demand.
`class`
`ModuleResource`
`Resource` implementation for `Module` resolution, performing `ModuleResource.getInputStream()` access via `Module.getResourceAsStream(java.lang.String)`.
`class`
`PathResource`
`Resource` implementation for `Path` handles, performing all operations and transformations via the `Path` API.
`class`
`UrlResource`
`Resource` implementation for `java.net.URL` locators.
`class`
`VfsResource`
JBoss VFS based `Resource` implementation.
Methods in org.springframework.core.io that return Resource
Modifier and Type
Method
Description
`Resource`
AbstractResource.`createRelative(String relativePath)`
This implementation throws a FileNotFoundException, assuming that relative resources cannot be created for this resource.
`Resource`
ClassPathResource.`createRelative(String relativePath)`
This implementation creates a `ClassPathResource`, applying the given path relative to the path used to create this descriptor.
`Resource`
DefaultResourceLoader.ClassPathContextResource.`createRelative(String relativePath)`
`Resource`
FileSystemResource.`createRelative(String relativePath)`
This implementation creates a FileSystemResource, applying the given path relative to the path of the underlying file of this resource descriptor.
`Resource`
FileUrlResource.`createRelative(String relativePath)`
`Resource`
ModuleResource.`createRelative(String relativePath)`
`Resource`
PathResource.`createRelative(String relativePath)`
This implementation creates a `PathResource`, applying the given path relative to the path of the underlying file of this resource descriptor.
`Resource`
Resource.`createRelative(String relativePath)`
Create a resource relative to this resource.
`Resource`
UrlResource.`createRelative(String relativePath)`
This implementation creates a `UrlResource`, delegating to `UrlResource.createRelativeURL(String)` for adapting the relative path.
`Resource`
VfsResource.`createRelative(String relativePath)`
`Resource`
DefaultResourceLoader.`getResource(String location)`
`Resource`
ResourceLoader.`getResource(String location)`
Return a `Resource` handle for the specified resource location.
`protected Resource`
ClassRelativeResourceLoader.`getResourceByPath(String path)`
`protected Resource`
DefaultResourceLoader.`getResourceByPath(String path)`
Return a Resource handle for the resource at the given path.
`protected Resource`
FileSystemResourceLoader.`getResourceByPath(String path)`
Resolve resource paths as file system paths.
`Resource`
ProtocolResolver.`resolve(String location, ResourceLoader resourceLoader)`
Resolve the given location against the given resource loader if this implementation's protocol matches.
Methods in org.springframework.core.io that return types with arguments of type Resource
Modifier and Type
Method
Description
`<T> Map<Resource,T>`
DefaultResourceLoader.`getResourceCache(Class<T> valueType)`
Obtain a cache for the given value type, keyed by `Resource`.

## Uses of Resource in org.springframework.core.io.buffer

Methods in org.springframework.core.io.buffer with parameters of type Resource
Modifier and Type
Method
Description
`static reactor.core.publisher.Flux<DataBuffer>`
DataBufferUtils.`read(Resource resource, long position, DataBufferFactory bufferFactory, int bufferSize)`
Read the given `Resource` into a `Flux` of `DataBuffer`s starting at the given position.
`static reactor.core.publisher.Flux<DataBuffer>`
DataBufferUtils.`read(Resource resource, DataBufferFactory bufferFactory, int bufferSize)`
Read the given `Resource` into a `Flux` of `DataBuffer`s.

## Uses of Resource in org.springframework.core.io.support

Methods in org.springframework.core.io.support that return Resource
Modifier and Type
Method
Description
`protected Resource`
PathMatchingResourcePatternResolver.`convertClassLoaderURL(URL url)`
Convert the given URL as returned from the configured `ClassLoader` into a `Resource`, applying to path lookups without a pattern (see `PathMatchingResourcePatternResolver.findAllClassPathResources(java.lang.String)`).
`protected Resource[]`
PathMatchingResourcePatternResolver.`findAllClassPathResources(String location)`
Find all class location resources with the given location via the ClassLoader.
`Resource`
LocalizedResourceHelper.`findLocalizedResource(String name, String extension, Locale locale)`
Find the most specific localized resource for the given name, extension and locale:
`protected Resource[]`
PathMatchingResourcePatternResolver.`findPathMatchingResources(String locationPattern)`
Find all resources that match the given location pattern via the Ant-style `PathMatcher`.
`final Resource`
EncodedResource.`getResource()`
Return the `Resource` held by this `EncodedResource`.
`Resource`
PathMatchingResourcePatternResolver.`getResource(String location)`
`Resource`
ResourceRegion.`getResource()`
Return the underlying `Resource` for this `ResourceRegion`.
`Resource[]`
PathMatchingResourcePatternResolver.`getResources(String locationPattern)`
`Resource[]`
ResourcePatternResolver.`getResources(String locationPattern)`
Resolve the given location pattern into `Resource` objects.
`protected Resource`
PathMatchingResourcePatternResolver.`resolveRootDirResource(Resource original)`
Resolve the supplied root directory resource for path matching.
Methods in org.springframework.core.io.support that return types with arguments of type Resource
Modifier and Type
Method
Description
`protected Set<Resource>`
PathMatchingResourcePatternResolver.`doFindAllClassPathResources(String path)`
Find all class path resources with the given path via the configured `ClassLoader`.
`protected Set<Resource>`
PathMatchingResourcePatternResolver.`doFindPathMatchingFileResources(Resource rootDirResource, String subPattern)`
Find all resources in the file system of the supplied root directory that match the given location sub pattern via the Ant-style `PathMatcher`.
`protected Set<Resource>`
PathMatchingResourcePatternResolver.`doFindPathMatchingJarResources(Resource rootDirResource, URL rootDirUrl, String subPattern)`
Find all resources in jar files that match the given location pattern via the Ant-style `PathMatcher`.
`protected Set<Resource>`
PathMatchingResourcePatternResolver.`findAllModulePathResources(String locationPattern)`
Resolve the given location pattern into `Resource` objects for all matching resources found in the module path.
Methods in org.springframework.core.io.support with parameters of type Resource
Modifier and Type
Method
Description
`protected Set<Resource>`
PathMatchingResourcePatternResolver.`doFindPathMatchingFileResources(Resource rootDirResource, String subPattern)`
Find all resources in the file system of the supplied root directory that match the given location sub pattern via the Ant-style `PathMatcher`.
`protected Set<Resource>`
PathMatchingResourcePatternResolver.`doFindPathMatchingJarResources(Resource rootDirResource, URL rootDirUrl, String subPattern)`
Find all resources in jar files that match the given location pattern via the Ant-style `PathMatcher`.
`static void`
PropertiesLoaderUtils.`fillProperties(Properties props, Resource resource)`
Fill the given properties from the given resource (in ISO-8859-1 encoding).
`protected boolean`
PathMatchingResourcePatternResolver.`isJarResource(Resource resource)`
Determine if the given resource handle indicates a jar resource that the `PathMatchingResourcePatternResolver.doFindPathMatchingJarResources(org.springframework.core.io.Resource, java.net.URL, java.lang.String)` method can handle.
`static Properties`
PropertiesLoaderUtils.`loadProperties(Resource resource)`
Load properties from the given resource (in ISO-8859-1 encoding).
`protected Resource`
PathMatchingResourcePatternResolver.`resolveRootDirResource(Resource original)`
Resolve the supplied root directory resource for path matching.
`void`
PropertiesLoaderSupport.`setLocation(Resource location)`
Set a location of a properties file to be loaded.
`void`
PropertiesLoaderSupport.`setLocations(Resource... locations)`
Set locations of properties files to be loaded.
Method parameters in org.springframework.core.io.support with type arguments of type Resource
Modifier and Type
Method
Description
`protected void`
PathMatchingResourcePatternResolver.`addAllClassLoaderJarRoots(ClassLoader classLoader, Set<Resource> result)`
Search all `URLClassLoader` URLs for jar file references and add each to the given set of resources in the form of a pointer to the root of the jar file content.
`protected void`
PathMatchingResourcePatternResolver.`addClassPathManifestEntries(Set<Resource> result)`
Determine jar file references from `Class-Path` manifest entries (which are added to the `java.class.path` JVM system property by the system class loader) and add each to the given set of resources in the form of a pointer to the root of the jar file content.
Constructors in org.springframework.core.io.support with parameters of type Resource
Modifier
Constructor
Description
``
`EncodedResource(Resource resource)`
Create a new `EncodedResource` for the given `Resource`, not specifying an explicit encoding or `Charset`.
``
`EncodedResource(Resource resource, String encoding)`
Create a new `EncodedResource` for the given `Resource`, using the specified `encoding`.
``
`EncodedResource(Resource resource, Charset charset)`
Create a new `EncodedResource` for the given `Resource`, using the specified `Charset`.
``
`ResourcePropertySource(String name, Resource resource)`
Create a PropertySource having the given name based on Properties loaded from the given encoded resource.
``
`ResourcePropertySource(Resource resource)`
Create a PropertySource based on Properties loaded from the given resource.
``
`ResourceRegion(Resource resource, long position, long count)`
Create a new `ResourceRegion` from a given `Resource`.

## Uses of Resource in org.springframework.core.type.classreading

Methods in org.springframework.core.type.classreading that return Resource
Modifier and Type
Method
Description
`Resource`
MetadataReader.`getResource()`
Return the resource reference for the class file.
Methods in org.springframework.core.type.classreading with parameters of type Resource
Modifier and Type
Method
Description
`MetadataReader`
CachingMetadataReaderFactory.`getMetadataReader(Resource resource)`
`MetadataReader`
MetadataReaderFactory.`getMetadataReader(Resource resource)`
Obtain a MetadataReader for the given resource.
`MetadataReader`
SimpleMetadataReaderFactory.`getMetadataReader(Resource resource)`