org.codehaus.groovy.grails.support
Class MockStringResourceLoader

java.lang.Object
  extended by org.springframework.core.io.DefaultResourceLoader
      extended by org.codehaus.groovy.grails.support.MockResourceLoader
          extended by org.codehaus.groovy.grails.support.MockStringResourceLoader
All Implemented Interfaces:
ResourceLoader

public class MockStringResourceLoader
extends MockResourceLoader

A ResourceLoader that loads Resources from Strings that are registered as Mock resources

Since:
0.4

Created: Feb 23, 2007 Time: 2:00:15 PM

Author:
Graeme Rocher

Field Summary
 
Fields inherited from interface org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIX
 
Constructor Summary
MockStringResourceLoader()
           
 
Method Summary
 Resource getResource(String location)
           
 void registerMockResource(String location, byte[] contents)
          Registers a mock resource with the first argument as the location and the second as the contents of the resource
 void registerMockResource(String location, String contents)
          Registers a mock resource with the first argument as the location and the second as the contents of the resource
 
Methods inherited from class org.springframework.core.io.DefaultResourceLoader
getClassLoader, getResourceByPath, setClassLoader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockStringResourceLoader

public MockStringResourceLoader()
Method Detail

getResource

public Resource getResource(String location)
Specified by:
getResource in interface ResourceLoader
Overrides:
getResource in class MockResourceLoader

registerMockResource

public void registerMockResource(String location,
                                 String contents)
Registers a mock resource with the first argument as the location and the second as the contents of the resource

Parameters:
location - The location
contents - The contents of the resource

registerMockResource

public void registerMockResource(String location,
                                 byte[] contents)
Registers a mock resource with the first argument as the location and the second as the contents of the resource

Parameters:
location - The location
contents - The contents of the resource


Copyright (c) 2005-2006 The Grails project