public abstract class AbstractResourceStreamWriter extends Object implements IResourceStreamWriter
IResourceStreamWriter.write(java.io.OutputStream)
. Don't forget to overwrite the
IResourceStream.length()
method if you do know the total
length that will be generated.IResourceStreamWriter
,
Serialized FormConstructor and Description |
---|
AbstractResourceStreamWriter() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the resource.
|
String |
getContentType()
Gets the mime type of this resource
|
InputStream |
getInputStream()
this method should not be used as it is not required for resource writers
|
Locale |
getLocale() |
String |
getStyle() |
String |
getVariation() |
Time |
lastModifiedTime()
Just returns now.
|
Bytes |
length()
Default implementation to returns
null , i.e. |
void |
setLocale(Locale locale)
This method shouldn't be used from the outside.
|
void |
setStyle(String style)
This method shouldn't be used from the outside.
|
void |
setVariation(String variation)
This method shouldn't be used from the outside.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
write
public Bytes length()
null
, i.e. chunked-encoding will be used.
Do override this if you know the length up front.length
in interface IResourceStream
null
if unknownpublic Locale getLocale()
getLocale
in interface IResourceStream
public void setLocale(Locale locale)
IResourceStream
setLocale
in interface IResourceStream
locale
- The Locale where this stream did resolve to.public Time lastModifiedTime()
lastModifiedTime
in interface IModifiable
Time
or
null
if that information is not availablepublic final InputStream getInputStream()
getInputStream
in interface IResourceStream
IResourceStream.close()
public void close() throws IOException
This implementation does nothing.
close
in interface Closeable
close
in interface AutoCloseable
close
in interface IResourceStream
IOException
- if an error occurred.public String getContentType()
IResourceStream
getContentType
in interface IResourceStream
public String getStyle()
getStyle
in interface IResourceStream
public void setStyle(String style)
IResourceStream
setStyle
in interface IResourceStream
style
- The style where this stream did resolve to.public String getVariation()
getVariation
in interface IResourceStream
public void setVariation(String variation)
IResourceStream
setVariation
in interface IResourceStream
variation
- The Variation where this stream did resolve to.Copyright © 2006–2022 Apache Software Foundation. All rights reserved.