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 ResourceKeygetKey()protected RuntimeExceptionhandleError(IOException e)ReaderopenReader()InputStreamopenStream()byte[]readBytes()List<String>readLines()StringreadString()voidrequireExists()-
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()
-
openStream
public final InputStream openStream()
- Specified by:
openStreamin interfaceResource
-
openReader
public final Reader openReader()
- Specified by:
openReaderin interfaceResource
-
requireExists
public final void requireExists()
- Specified by:
requireExistsin interfaceResource
-
readString
public final String readString()
- Specified by:
readStringin interfaceResource
-
handleError
protected final RuntimeException handleError(IOException e)
-
-