org.springframework.web.reactive.resource

## Class TransformedResource

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

- All Implemented Interfaces:
    InputStreamSource, Resource

      public class TransformedResource
      extends ByteArrayResource

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

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TransformedResource(Resource original, byte[] transformedContent)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getFilename()` This implementation always returns `null`, assuming that this resource type does not have a filename.
    `long` | `lastModified()` This implementation checks the timestamp of the underlying File, if available.

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

      `contentLength, equals, exists, getByteArray, 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 Detail

    - #### TransformedResource

          public TransformedResource(Resource original,
                                     byte[] transformedContent)

  - ### Method Detail

    - #### getFilename

          @Nullable
          public String getFilename()

      Description copied from class: `AbstractResource`
      This implementation always returns `null`, assuming that this resource type does not have a filename.
      Specified by:
        `getFilename` in interface `Resource`
      Overrides:
        `getFilename` in class `AbstractResource`

    - #### lastModified

          public long lastModified()

      Description copied from class: `AbstractResource`
      This implementation checks the timestamp of the underlying File, if available.
      Specified by:
        `lastModified` in interface `Resource`
      Overrides:
        `lastModified` in class `AbstractResource`
      See Also:
        `AbstractResource.getFileForLastModifiedCheck()`