Package org.springframework.web.servlet.resource

# Class TransformedResource

java.lang.Object
org.springframework.core.io.AbstractResource
org.springframework.core.io.ByteArrayResource
org.springframework.web.servlet.resource.TransformedResource

All Implemented Interfaces:
  `org.springframework.core.io.InputStreamSource`, `org.springframework.core.io.Resource`

public class TransformedResource extends org.springframework.core.io.ByteArrayResource
An extension of `ByteArrayResource` that a `ResourceTransformer` can use to represent an original resource preserving all other information except the content.

Since:
  4.1
Author:
  Jeremy Grelle, Rossen Stoyanchev

## Constructor Summary

Constructors
Constructor
Description
`TransformedResource(org.springframework.core.io.Resource original, byte[] transformedContent)`

## Method Summary

Modifier and Type
Method
Description
`String`
`getFilename()`
`long`
`lastModified()`

### Methods inherited from class org.springframework.core.io.ByteArrayResource

`contentLength, equals, exists, getByteArray, getContentAsByteArray, getContentAsString, getDescription, getInputStream, hashCode`

### Methods inherited from class org.springframework.core.io.AbstractResource

`createRelative, getFile, getFileForLastModifiedCheck, getURI, getURL, isFile, isOpen, isReadable, readableChannel, toString`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Constructor Details

### TransformedResource

public TransformedResource(org.springframework.core.io.Resource original, byte[] transformedContent)

## Method Details

### getFilename

@Nullable public String getFilename()

Specified by:
  `getFilename` in interface `org.springframework.core.io.Resource`
Overrides:
  `getFilename` in class `org.springframework.core.io.AbstractResource`

### lastModified

public long lastModified() throws IOException

Specified by:
  `lastModified` in interface `org.springframework.core.io.Resource`
Overrides:
  `lastModified` in class `org.springframework.core.io.AbstractResource`
Throws:
  `IOException`