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, setVariation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getLocale, getStyle, getVariation, setLocale, setStyle, setVariation
public 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 IStringResourceStream
protected Charset getCharset()
public void setCharset(Charset charset)
setCharset
in interface IStringResourceStream
charset
- Charset for componentpublic void close() throws IOException
IResourceStream
close
in interface Closeable
close
in interface AutoCloseable
close
in interface IResourceStream
IOException
IResourceStream.close()
public String getContentType()
IResourceStream
getContentType
in interface IResourceStream
getContentType
in class AbstractResourceStream
IResourceStream.getContentType()
public InputStream getInputStream() throws ResourceStreamNotFoundException
IResourceStream
getInputStream
in interface IResourceStream
ResourceStreamNotFoundException
IResourceStream.getInputStream()
public Time lastModifiedTime()
IModifiable
lastModifiedTime
in interface IModifiable
lastModifiedTime
in class AbstractResourceStream
Time
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()
IResourceStream
length
in interface IResourceStream
length
in class AbstractResourceStream
null
if unknownCopyright © 2006–2022 Apache Software Foundation. All rights reserved.