Package com.enonic.xp.resource

## Class ResourceBase

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

- All Implemented Interfaces:
    `Resource`
  Direct Known Subclasses:
    `BytesResource`, `MockResource`, `UrlResource`

      public abstract class ResourceBase
      extends Object
      implements Resource

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `ResourceBase​(ResourceKey key)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `ResourceKey` | `getKey()` |
    `protected RuntimeException` | `handleError​(IOException e)` |
    `Reader` | `openReader()` |
    `InputStream` | `openStream()` |
    `byte[]` | `readBytes()` |
    `List<String>` | `readLines()` |
    `String` | `readString()` |
    `void` | `requireExists()` |

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

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

    - ### Methods inherited from interface com.enonic.xp.resource.Resource

      `exists, getBytes, getResolverName, getSize, getTimestamp, getUrl`

- - ### Constructor Detail

    - #### ResourceBase

          public ResourceBase​(ResourceKey key)

  - ### Method Detail

    - #### getKey

          public final ResourceKey getKey()

      Specified by:
        `getKey` in interface `Resource`

    - #### openStream

          public final InputStream openStream()

      Specified by:
        `openStream` in interface `Resource`

    - #### openReader

          public final Reader openReader()

      Specified by:
        `openReader` in interface `Resource`

    - #### requireExists

          public final void requireExists()

      Specified by:
        `requireExists` in interface `Resource`

    - #### readString

          public final String readString()

      Specified by:
        `readString` in interface `Resource`

    - #### readBytes

          public final byte[] readBytes()

      Specified by:
        `readBytes` in interface `Resource`

    - #### readLines

          public final List<String> readLines()

      Specified by:
        `readLines` in interface `Resource`

    - #### handleError

          protected final RuntimeException handleError​(IOException e)