类 WritableResourceDecorator
java.lang.Object
cn.taketoday.core.io.ResourceDecorator
cn.taketoday.core.io.WritableResourceDecorator
- 所有已实现的接口:
InputStreamSource,OutputStreamSource,Resource,WritableResource,ThrowingConsumer<OutputStream>,Consumer<OutputStream>
- 从以下版本开始:
- 4.0 2022/3/2 10:26
- 作者:
- Harry Yang
-
字段概要
从类继承的字段 cn.taketoday.core.io.ResourceDecorator
delegate从接口继承的字段 cn.taketoday.core.io.Resource
EMPTY_ARRAY -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明Return anOutputStreamfor the underlying resource, allowing to (over-)write its content.GetWriterbooleanIndicate whether the contents of this resource can be written viaOutputStreamSource.getOutputStream().Return aWritableByteChannel.protected WritableResource从类继承的方法 cn.taketoday.core.io.ResourceDecorator
contentLength, createRelative, equals, exists, getDelegate, getFile, getInputStream, getName, getReader, getReader, getURI, getURL, hashCode, isDirectory, isFile, isOpen, isReadable, lastModified, list, list, readableChannel, setDelegate, toString从接口继承的方法 cn.taketoday.core.io.InputStreamSource
acceptWithException, getInputStream, getReader, getReader, readableChannel, transferTo从接口继承的方法 cn.taketoday.core.io.Resource
contentLength, createRelative, exists, getContentAsByteArray, getContentAsString, getFile, getName, getURI, getURL, isDirectory, isFile, isOpen, isReadable, lastModified, list, list, toString从接口继承的方法 cn.taketoday.util.function.ThrowingConsumer
accept, accept, throwing
-
构造器详细资料
-
WritableResourceDecorator
protected WritableResourceDecorator() -
WritableResourceDecorator
-
-
方法详细资料
-
getOutputStream
从接口复制的说明:OutputStreamSourceReturn anOutputStreamfor the underlying resource, allowing to (over-)write its content.- 指定者:
getOutputStream在接口中OutputStreamSource- 抛出:
IOException- if the stream could not be opened
-
getWriter
从接口复制的说明:OutputStreamSourceGetWriter- 指定者:
getWriter在接口中OutputStreamSource- 抛出:
IOException- if the stream could not be opened
-
writableChannel
从接口复制的说明:OutputStreamSourceReturn aWritableByteChannel.It is expected that each call creates a fresh channel.
The default implementation returns
Channels.newChannel(OutputStream)with the result ofOutputStreamSource.getOutputStream().- 指定者:
writableChannel在接口中OutputStreamSource- 返回:
- the byte channel for the underlying resource (must not be
null) - 抛出:
FileNotFoundException- if the underlying resource doesn't existIOException- if the content channel could not be opened- 另请参阅:
-
isWritable
public boolean isWritable()从接口复制的说明:WritableResourceIndicate whether the contents of this resource can be written viaOutputStreamSource.getOutputStream().Will be
truefor typical resource descriptors; note that actual content writing may still fail when attempted. However, a value offalseis a definitive indication that the resource content cannot be modified. -
writableResource
- 抛出:
UnsupportedOperationException- not a WritableResource
-