站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Spring Framework 2.1.0 API 文档英文版

EncodedResource (Spring Framework API 2.1) - Spring Framework 2.1.0 API 文档英文版


The Spring Framework

org.springframework.core.io.support
Class EncodedResource

java.lang.Object
  extended by org.springframework.core.io.support.EncodedResource

public class EncodedResource
extends Object

Holder that combines a Resource with an encoding.

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

Since:
1.2.6
Author:
Juergen Hoeller
See Also:
Reader

Constructor Summary
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.
 
Method Summary
 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).
 Resource getResource()
          Return the Resource held.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EncodedResource

public EncodedResource(Resource resource)
Create a new EncodedResource for the given Resource, not specifying a specific encoding.

Parameters:
resource - the Resource to hold

EncodedResource

public EncodedResource(Resource resource,
                       String encoding)
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
Method Detail

getResource

public Resource getResource()
Return the Resource held.


getEncoding

public String getEncoding()
Return the encoding to use for reading from the resource, or null if none specified.


getReader

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

Throws:
IOException - if opening the Reader failed

The Spring Framework

Copyright © 2002-2007 The Spring Framework.