Class TextResource
java.lang.Object
com.aquima.interactions.foundation.io.resource.ResourceDelegate
com.aquima.interactions.foundation.io.resource.TextResource
- All Implemented Interfaces:
IResource
This resource implementation can be used to read/write textual data to/from a resource with a specific character set.
(See AQU-4396)
- Since:
- 7.2
- Author:
- V. Jansen, Jon van Leuven
-
Constructor Summary
ConstructorsConstructorDescriptionTextResource
(IResource resource, String characterSet) Constructor to create a text resource with a delegate resource an a character set. -
Method Summary
Methods inherited from class com.aquima.interactions.foundation.io.resource.ResourceDelegate
asInputStream, asOutputStream, createFile, createFolder, getDelegate, getInfo, getRelative
-
Constructor Details
-
TextResource
Constructor to create a text resource with a delegate resource an a character set.- Parameters:
resource
- The delegate resource, may not be null.characterSet
- The character set, may not be null.
-
-
Method Details
-
asReader
This method returns a reader with the character set of this text resource.- Specified by:
asReader
in interfaceIResource
- Overrides:
asReader
in classResourceDelegate
- Returns:
- reader The reader.
- Throws:
ResourceException
- This exception is thrown when the resource could not be read.
-
asWriter
This method returns a writer with the character set of this text resource.- Specified by:
asWriter
in interfaceIResource
- Overrides:
asWriter
in classResourceDelegate
- Parameters:
append
- Boolean indicating if the data added to the writer should be appended to the resource.- Returns:
- writer The writer.
- Throws:
ResourceException
- This exception is thrown when no writer is available for the resource (for instance due to the resource being read-only).
-