Class EncodedResource

java.lang.Object
org.springframework.core.io.support.EncodedResource
All Implemented Interfaces:
InputStreamSource

public class EncodedResource extends Object implements InputStreamSource
Holder that combines a Resource descriptor with a specific encoding or Charset to be used for reading from the resource.

Used as an argument for operations that support reading content with a specific encoding, typically via a java.io.Reader.

Since:
1.2.6
Author:
Juergen Hoeller, Sam Brannen, Arjen Poutsma
See Also:
  • Constructor Details

    • EncodedResource

      public EncodedResource(Resource resource)
      Create a new EncodedResource for the given Resource, not specifying an explicit encoding or Charset.
      Parameters:
      resource - the Resource to hold (never null)
    • EncodedResource

      public EncodedResource(Resource resource, @Nullable String encoding)
      Create a new EncodedResource for the given Resource, using the specified encoding.
      Parameters:
      resource - the Resource to hold (never null)
      encoding - the encoding to use for reading from the resource
    • EncodedResource

      public EncodedResource(Resource resource, @Nullable Charset charset)
      Create a new EncodedResource for the given Resource, using the specified Charset.
      Parameters:
      resource - the Resource to hold (never null)
      charset - the Charset to use for reading from the resource
  • Method Details