## org.codehaus.groovy.grails.support
Class MockFileResource

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

All Implemented Interfaces:
  InputStreamSource, Resource

    public class MockFileResource

extends ByteArrayResource

A resource that mocks the behavior of a FileResource

Since:
  1.1

  Created: Feb 6, 2009
Author:
  Graeme Rocher

Constructor Summary
`MockFileResource(String fileName, String contents)`
`MockFileResource(String fileName, String contents, String encoding)`

Method Summary
`String` `getFilename()`

Methods inherited from class org.springframework.core.io.ByteArrayResource
`equals, exists, getByteArray, getDescription, getInputStream, hashCode`

Methods inherited from class org.springframework.core.io.AbstractResource
`createRelative, getFile, getFileForLastModifiedCheck, getURI, getURL, isOpen, isReadable, lastModified, toString`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Constructor Detail

### MockFileResource

    public MockFileResource(String fileName,
                            String contents)
                     throws UnsupportedEncodingException

Throws:
  `UnsupportedEncodingException`

### MockFileResource

    public MockFileResource(String fileName,
                            String contents,
                            String encoding)
                     throws UnsupportedEncodingException

Throws:
  `UnsupportedEncodingException`

Method Detail

### 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