类 TransformedResource
- java.lang.Object
- org.springframework.core.io.AbstractResource
- org.springframework.core.io.ByteArrayResource
- org.springframework.web.servlet.resource.TransformedResource
- 所有已实现的接口:
InputStreamSource
,Resource
public class TransformedResource extends ByteArrayResource
An extension ofByteArrayResource
that aResourceTransformer
can use to represent an original resource preserving all other information except the content.- 从以下版本开始:
- 4.1
- 作者:
- Jeremy Grelle, Rossen Stoyanchev
构造器概要
构造器 构造器 说明 TransformedResource(Resource original, byte[] transformedContent)
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 String
getFilename()
This implementation always returnsnull
, assuming that this resource type does not have a filename.long
lastModified()
This implementation checks the timestamp of the underlying File, if available.从类继承的方法 org.springframework.core.io.ByteArrayResource
contentLength, equals, exists, getByteArray, getDescription, getInputStream, hashCode
从类继承的方法 org.springframework.core.io.AbstractResource
createRelative, getFile, getFileForLastModifiedCheck, getURI, getURL, isOpen, isReadable, toString
构造器详细资料
TransformedResource
public TransformedResource(Resource original, byte[] transformedContent)
方法详细资料
getFilename
public String getFilename()
从类复制的说明:AbstractResource
This implementation always returnsnull
, assuming that this resource type does not have a filename.- 指定者:
getFilename
在接口中Resource
- 覆盖:
getFilename
在类中AbstractResource
lastModified
public long lastModified() throws IOException
从类复制的说明:AbstractResource
This implementation checks the timestamp of the underlying File, if available.- 指定者:
lastModified
在接口中Resource
- 覆盖:
lastModified
在类中AbstractResource
- 抛出:
IOException
- if the resource cannot be resolved (in the file system or as some other known physical resource type)- 另请参阅:
AbstractResource.getFileForLastModifiedCheck()