public class

EncodedResource

extends Object
java.lang.Object
   ↳ org.springframework.core.io.support.EncodedResource

Class Overview

Holder that combines a Resource with a specific encoding to be used for reading from the resource.

Used as argument for operations that support to read content with a specific encoding (usually through a java.io.Reader.

See Also

Summary

Public Constructors
EncodedResource(Resource resource)
Create a new EncodedResource for the given Resource, not specifying a specific encoding.
EncodedResource(Resource resource, String encoding)
Create a new EncodedResource for the given Resource, using the specified encoding.
Public Methods
boolean equals(Object obj)
final String getEncoding()
Return the encoding to use for reading from the resource, or null if none specified.
Reader getReader()
Open a java.io.Reader for the specified resource, using the specified encoding (if any).
final Resource getResource()
Return the Resource held.
int hashCode()
String toString()
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public EncodedResource (Resource resource)

Also: SpringCore

Create a new EncodedResource for the given Resource, not specifying a specific encoding.

Parameters
resource the Resource to hold

public EncodedResource (Resource resource, String encoding)

Also: SpringCore

Create a new EncodedResource for the given Resource, using the specified encoding.

Parameters
resource the Resource to hold
encoding the encoding to use for reading from the resource

Public Methods

public boolean equals (Object obj)

public final String getEncoding ()

Also: SpringCore

Return the encoding to use for reading from the resource, or null if none specified.

public Reader getReader ()

Also: SpringCore

Open a java.io.Reader for the specified resource, using the specified encoding (if any).

Throws
IOException if opening the Reader failed

public final Resource getResource ()

Also: SpringCore

Return the Resource held.

public int hashCode ()

public String toString ()