Groovy Documentation

org.codehaus.groovy.grails.support
[Java] Class GrailsByteArrayResource

java.lang.Object
  org.springframework.core.io.ByteArrayResource
      org.codehaus.groovy.grails.support.GrailsByteArrayResource

public class GrailsByteArrayResource
extends 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
GrailsByteArrayResource(byte[] byteArray)

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

 
Method Summary
java.lang.String getFilename()

java.net.URL getURL()

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

 

Constructor Detail

GrailsByteArrayResource

public GrailsByteArrayResource(byte[] byteArray)


GrailsByteArrayResource

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


 
Method Detail

getFilename

@Override
public java.lang.String getFilename()


getURL

@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.


 

Groovy Documentation