Package org.grails.core.io
Class GrailsByteArrayResource
- java.lang.Object
-
- org.springframework.core.io.AbstractResource
-
- org.springframework.core.io.ByteArrayResource
-
- org.grails.core.io.GrailsByteArrayResource
-
- All Implemented Interfaces:
org.springframework.core.io.InputStreamSource,org.springframework.core.io.Resource
public class GrailsByteArrayResource extends org.springframework.core.io.ByteArrayResourceHacky version of the ByteArrayResource that implements thegetURL()method, required for the resource to work with Spring's ServletContextResource.
-
-
Constructor Summary
Constructors Constructor Description GrailsByteArrayResource(byte[] byteArray)GrailsByteArrayResource(byte[] byteArray, java.lang.String location)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetFilename()java.net.URLgetURL()Overrides the default behaviour to generate a fake "file:" URL so that the resource can be used from a ServletContextResource.-
Methods inherited from class org.springframework.core.io.ByteArrayResource
contentLength, equals, exists, getByteArray, getDescription, getInputStream, hashCode
-
-
-
-
Method Detail
-
getURL
public java.net.URL getURL() throws java.io.IOExceptionOverrides the default behaviour to generate a fake "file:" URL so that the resource can be used from a ServletContextResource.- Specified by:
getURLin interfaceorg.springframework.core.io.Resource- Overrides:
getURLin classorg.springframework.core.io.AbstractResource- Throws:
java.io.IOException
-
getFilename
public java.lang.String getFilename() throws java.lang.IllegalStateException- Specified by:
getFilenamein interfaceorg.springframework.core.io.Resource- Overrides:
getFilenamein classorg.springframework.core.io.AbstractResource- Throws:
java.lang.IllegalStateException
-
-