Package com.enonic.xp.resource

## Class MockResource

- java.lang.Object
- - com.enonic.xp.resource.ResourceBase
  - - com.enonic.xp.resource.MockResource

- All Implemented Interfaces:
    `Resource`

      public class MockResource
      extends ResourceBase

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `MockResource​(ResourceKey key, byte[] bytes, long timestamp)` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static MockResource` | `empty​(ResourceKey key, long timestamp)` |
    `boolean` | `exists()` |
    `ByteSource` | `getBytes()` |
    `String` | `getResolverName()` |
    `long` | `getSize()` |
    `long` | `getTimestamp()` |
    `URL` | `getUrl()` |
    `static MockResource` | `missing​(ResourceKey key)` |

    - ### Methods inherited from class com.enonic.xp.resource.ResourceBase

      `getKey, handleError, openReader, openStream, readBytes, readLines, readString, requireExists`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### MockResource

          public MockResource​(ResourceKey key,
                              byte[] bytes,
                              long timestamp)

  - ### Method Detail

    - #### missing

          public static MockResource missing​(ResourceKey key)

    - #### empty

          public static MockResource empty​(ResourceKey key,
                                           long timestamp)

    - #### getUrl

          public URL getUrl()

    - #### exists

          public boolean exists()

    - #### getSize

          public long getSize()

    - #### getTimestamp

          public long getTimestamp()

    - #### getBytes

          public ByteSource getBytes()

    - #### getResolverName

          public String getResolverName()