Package org.grails.core.io
Class MockStringResourceLoader
- java.lang.Object
-
- org.springframework.core.io.DefaultResourceLoader
-
- org.grails.core.io.MockResourceLoader
-
- org.grails.core.io.MockStringResourceLoader
-
- All Implemented Interfaces:
org.springframework.core.io.ResourceLoader
public class MockStringResourceLoader extends MockResourceLoader
Loads Resources from Strings that are registered as Mock resources.- Since:
- 0.4
-
-
Constructor Summary
Constructors Constructor Description MockStringResourceLoader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.core.io.ResourcegetResource(java.lang.String location)voidregisterMockResource(java.lang.String location, byte[] contents)Registers a mock resource with the first argument as the location and the second as the contents of the resource.voidregisterMockResource(java.lang.String location, java.lang.String contents)Registers a mock resource with the first argument as the location and the second as the contents of the resource.voidregisterMockResource(java.lang.String location, org.springframework.core.io.Resource res)Registers a mock resource with the first argument as the location and the second as the contents of the resource.
-
-
-
Method Detail
-
getResource
public org.springframework.core.io.Resource getResource(java.lang.String location)
- Specified by:
getResourcein interfaceorg.springframework.core.io.ResourceLoader- Overrides:
getResourcein classMockResourceLoader
-
registerMockResource
public void registerMockResource(java.lang.String location, org.springframework.core.io.Resource res)Registers a mock resource with the first argument as the location and the second as the contents of the resource.- Parameters:
location- The locationres- The resource itself
-
registerMockResource
public void registerMockResource(java.lang.String location, java.lang.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 locationcontents- The contents of the resource
-
registerMockResource
public void registerMockResource(java.lang.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 locationcontents- The contents of the resource
-
-