- All Implemented Interfaces:
Asset
public class StringAsset
extends Object
implements Asset
Implementation of an
Asset
backed by a String
- Version:
- $Revision: $
-
-
Constructor Summary
Constructors
Creates a new
Asset
instance backed by the specified String
-
Method Summary
Returns the underlying content.
Get a input stream for the resource content.
-
Field Details
-
log
private static final Logger log
Logger
-
content
Underlying content.
-
Constructor Details
-
StringAsset
public StringAsset(String content)
Creates a new
Asset
instance backed by the specified String
- Parameters:
content
- The content represented as a String
- Throws:
IllegalArgumentException
- If the contents were not specified
-
Method Details
-
openStream
Description copied from interface: Asset
Get a input stream for the resource content. The caller is responsible for closing the stream.
- Specified by:
openStream
in interface Asset
- Returns:
- A new open
InputStream
for each call
- See Also:
-
-
getSource
Returns the underlying content.
-