org.codehaus.groovy.grails.support
Class GrailsByteArrayResource
java.lang.Object
org.springframework.core.io.AbstractResource
org.springframework.core.io.ByteArrayResource
org.codehaus.groovy.grails.support.GrailsByteArrayResource
- All Implemented Interfaces:
- InputStreamSource, Resource
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.
- Author:
- pledbrook
Method Summary |
String |
getFilename()
|
URL |
getURL()
Overrides the default behaviour to generate a fake "file:" URL
so that the resource can be used from a ServletContextResource. |
GrailsByteArrayResource
public GrailsByteArrayResource(byte[] byteArray)
GrailsByteArrayResource
public GrailsByteArrayResource(byte[] byteArray,
String location)
getURL
public URL getURL()
throws IOException
- Overrides the default behaviour to generate a fake "file:" URL
so that the resource can be used from a ServletContextResource.
- Specified by:
getURL
in interface Resource
- Overrides:
getURL
in class AbstractResource
- Throws:
IOException
getFilename
public String getFilename()
throws IllegalStateException
- Specified by:
getFilename
in interface Resource
- Overrides:
getFilename
in class AbstractResource
- Throws:
IllegalStateException
Copyright (c) 2005-2009 The Grails project