GrailsByteArrayResource (Grails 6.0.0)

Package: org.grails.core.io

## [Java] Class GrailsByteArrayResource

- org.grails.core.io.GrailsByteArrayResource

-     public class GrailsByteArrayResource
      extends org.springframework.core.io.ByteArrayResource

  Hacky version of the ByteArrayResource that implements the getURL() method, required for the resource to work with Spring's ServletContextResource.

  Authors:
    pledbrook

- - ### Constructor Summary

    Constructors
    Constructor and description
    `GrailsByteArrayResource (byte[] byteArray)`
    `GrailsByteArrayResource (byte[] byteArray, java.lang.String location)`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public java.lang.String` | `getFilename()`
    `` | `public java.net.URL` | `getURL()` Overrides the default behaviour to generate a fake "file:" URL so that the resource can be used from a ServletContextResource.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class org.springframework.core.io.ByteArrayResource` | `org.springframework.core.io.ByteArrayResource#contentLength(), org.springframework.core.io.ByteArrayResource#getByteArray(), org.springframework.core.io.ByteArrayResource#exists(), org.springframework.core.io.ByteArrayResource#getDescription(), org.springframework.core.io.ByteArrayResource#equals(java.lang.Object), org.springframework.core.io.ByteArrayResource#hashCode(), org.springframework.core.io.ByteArrayResource#getInputStream(), org.springframework.core.io.ByteArrayResource#getURL(), org.springframework.core.io.ByteArrayResource#createRelative(java.lang.String), org.springframework.core.io.ByteArrayResource#readableChannel(), org.springframework.core.io.ByteArrayResource#isReadable(), org.springframework.core.io.ByteArrayResource#getURI(), org.springframework.core.io.ByteArrayResource#isFile(), org.springframework.core.io.ByteArrayResource#lastModified(), org.springframework.core.io.ByteArrayResource#getFilename(), org.springframework.core.io.ByteArrayResource#toString(), org.springframework.core.io.ByteArrayResource#isOpen(), org.springframework.core.io.ByteArrayResource#getFile(), org.springframework.core.io.ByteArrayResource#wait(long), org.springframework.core.io.ByteArrayResource#wait(long, int), org.springframework.core.io.ByteArrayResource#wait(), org.springframework.core.io.ByteArrayResource#getClass(), org.springframework.core.io.ByteArrayResource#notify(), org.springframework.core.io.ByteArrayResource#notifyAll()`

- - ### Constructor Detail

    - #### public GrailsByteArrayResource(byte[] byteArray)

    - #### public GrailsByteArrayResource(byte[] byteArray, java.lang.String location)

  - ### Method Detail

    - #### @java.lang.Override public java.lang.String getFilename()

    - #### @java.lang.Override public java.net.URL getURL()

      Overrides the default behaviour to generate a fake "file:" URL so that the resource can be used from a ServletContextResource.