Top Description Fields Constructors Methods
org.springframework.web.reactive.resource

public Class TransformedResource

extends ByteArrayResource
Class Inheritance
Imports
java.io.IOException, org.springframework.core.io.ByteArrayResource, .Resource, org.springframework.lang.Nullable

An extension of ByteArrayResource that a ResourceTransformer can use to represent an original resource preserving all other information except the content.
Author
Rossen Stoyanchev
Since
5.0

Field Summary

Modifier and TypeField and Description
private final String
private final long

Constructor Summary

AccessConstructor and Description
public
TransformedResource(Resource original, byte[] transformedContent)

Method Summary

Modifier and TypeMethod and Description
public String
getFilename()

Overrides org.springframework.core.io.AbstractResource.getFilename.

Implements org.springframework.core.io.Resource.getFilename.

This implementation always returns null, assuming that this resource type does not have a filename.

public long
lastModified()

Overrides org.springframework.core.io.AbstractResource.lastModified.

Implements org.springframework.core.io.Resource.lastModified.

This implementation checks the timestamp of the underlying File, if available.

Inherited from org.springframework.core.io.ByteArrayResource:
contentLengthequalsexistsgetByteArraygetContentAsByteArraygetContentAsStringgetDescriptiongetInputStreamhashCode

Field Detail

filenameback to summary
private final String filename
Annotations
@Nullable
lastModifiedback to summary
private final long lastModified

Constructor Detail

TransformedResourceback to summary
public TransformedResource(Resource original, byte[] transformedContent)

Method Detail

getFilenameback to summary
public String getFilename()

Overrides org.springframework.core.io.AbstractResource.getFilename.

Implements org.springframework.core.io.Resource.getFilename.

Doc from org.springframework.core.io.AbstractResource.getFilename.

This implementation always returns null, assuming that this resource type does not have a filename.

Annotations
@Override
@Nullable
lastModifiedback to summary
public long lastModified()

Overrides org.springframework.core.io.AbstractResource.lastModified.

Implements org.springframework.core.io.Resource.lastModified.

Doc from org.springframework.core.io.AbstractResource.lastModified.

This implementation checks the timestamp of the underlying File, if available.

Annotations
@Override