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()
-
-
-
Constructor Detail
-
ResourceBase
public ResourceBase(ResourceKey key)
-
-
Method Detail
-
getKey
public final ResourceKey getKey()
-
openStream
public final InputStream openStream()
- Specified by:
openStream
in interfaceResource
-
openReader
public final Reader openReader()
- Specified by:
openReader
in interfaceResource
-
requireExists
public final void requireExists()
- Specified by:
requireExists
in interfaceResource
-
readString
public final String readString()
- Specified by:
readString
in interfaceResource
-
handleError
protected final RuntimeException handleError(IOException e)
-
-