public abstract class AbstractStringResourceStream extends AbstractResourceStream implements IStringResourceStream
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_CONTENT_TYPE
The content-type applied in case the resource stream's default constructor is used
|
| Constructor and Description |
|---|
AbstractStringResourceStream()
Constructor.
|
AbstractStringResourceStream(String contentType)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
String |
asString() |
void |
close()
Closes the resource.
|
protected Charset |
getCharset() |
String |
getContentType()
Gets the mime type of this resource
|
InputStream |
getInputStream()
Gets the resource stream.
|
protected abstract String |
getString() |
Time |
lastModifiedTime()
Gets the last time this modifiable thing changed.
|
Bytes |
length()
Gets the size of this resource
|
void |
setCharset(Charset charset)
Sets the character set used for reading this resource.
|
void |
setLastModified(Time lastModified) |
getLocale, getStyle, getVariation, setLocale, setStyle, setVariationclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetLocale, getStyle, getVariation, setLocale, setStyle, setVariationpublic static final String DEFAULT_CONTENT_TYPE
public AbstractStringResourceStream()
public AbstractStringResourceStream(String contentType)
contentType - The mime type of this resource, such as "image/jpeg" or "text/html"public String asString()
asString in interface IStringResourceStreamprotected Charset getCharset()
public void setCharset(Charset charset)
setCharset in interface IStringResourceStreamcharset - Charset for componentpublic void close()
throws IOException
IResourceStreamclose in interface Closeableclose in interface AutoCloseableclose in interface IResourceStreamIOExceptionIResourceStream.close()public String getContentType()
IResourceStreamgetContentType in interface IResourceStreamgetContentType in class AbstractResourceStreamIResourceStream.getContentType()public InputStream getInputStream() throws ResourceStreamNotFoundException
IResourceStreamgetInputStream in interface IResourceStreamResourceStreamNotFoundExceptionIResourceStream.getInputStream()public Time lastModifiedTime()
IModifiablelastModifiedTime in interface IModifiablelastModifiedTime in class AbstractResourceStreamTime or
null if that information is not availableIModifiable.lastModifiedTime()public void setLastModified(Time lastModified)
lastModified - The lastModified to set.protected abstract String getString()
public final Bytes length()
IResourceStreamlength in interface IResourceStreamlength in class AbstractResourceStreamnull if unknownCopyright © 2006–2021 Apache Software Foundation. All rights reserved.