Package: org.grails.core.io

## [Java] Class MockStringResourceLoader

- org.grails.core.io.MockStringResourceLoader

- Loads Resources from Strings that are registered as Mock resources.

  Authors:
    Graeme Rocher
  Since:
    0.4

- - Inherited fields
    Fields inherited from class | Fields
    --- | ---
    `class org.springframework.core.io.DefaultResourceLoader` | `CLASSPATH_URL_PREFIX`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `org.springframework.core.io.Resource` | `getResource(java.lang.String location)`
    `` | `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.
    `` | `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.
    `` | `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.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class MockResourceLoader` | `getResource`
    `class org.springframework.core.io.DefaultResourceLoader` | `org.springframework.core.io.DefaultResourceLoader#getProtocolResolvers(), org.springframework.core.io.DefaultResourceLoader#addProtocolResolver(org.springframework.core.io.ProtocolResolver), org.springframework.core.io.DefaultResourceLoader#setClassLoader(java.lang.ClassLoader), org.springframework.core.io.DefaultResourceLoader#getClassLoader(), org.springframework.core.io.DefaultResourceLoader#getResource(java.lang.String), org.springframework.core.io.DefaultResourceLoader#wait(long, int), org.springframework.core.io.DefaultResourceLoader#wait(long), org.springframework.core.io.DefaultResourceLoader#wait(), org.springframework.core.io.DefaultResourceLoader#equals(java.lang.Object), org.springframework.core.io.DefaultResourceLoader#toString(), org.springframework.core.io.DefaultResourceLoader#hashCode(), org.springframework.core.io.DefaultResourceLoader#getClass(), org.springframework.core.io.DefaultResourceLoader#notify(), org.springframework.core.io.DefaultResourceLoader#notifyAll()`

- - ### Method Detail

    - #### @java.lang.Override public org.springframework.core.io.Resource getResource(java.lang.String location)

    - #### 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 location
        `res` - The resource itself

    - #### 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 location
        `contents` - The contents of the resource

    - #### 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 location
        `contents` - The contents of the resource