接口 WritableResource
- 所有超级接口:
InputStreamSource,Resource
- 所有已知实现类:
FileSystemResource,FileUrlResource,PathResource
Copy from https://github.com/spring-projects/spring-framework.git, with less modifications
Extended interface for a resource that supports writing to it.
Provides an
OutputStream accessor.- 从以下版本开始:
- 3.1
- 作者:
- Juergen Hoeller
- 另请参阅:
-
方法概要
修饰符和类型方法说明Return anOutputStreamfor the underlying resource, allowing to (over-)write its content.default booleanIndicate whether the contents of this resource can be written viagetOutputStream().default WritableByteChannelReturn aWritableByteChannel.从接口继承的方法 com.alibaba.nacos.common.packagescan.resource.InputStreamSource
getInputStream从接口继承的方法 com.alibaba.nacos.common.packagescan.resource.Resource
contentLength, createRelative, exists, getDescription, getFile, getFilename, getUri, getUrl, isFile, isOpen, isReadable, lastModified, readableChannel
-
方法详细资料
-
isWritable
default boolean isWritable()Indicate whether the contents of this resource can be written viagetOutputStream().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. -
getOutputStream
Return anOutputStreamfor the underlying resource, allowing to (over-)write its content.- 抛出:
IOException- if the stream could not be opened- 另请参阅:
-
writableChannel
Return aWritableByteChannel.It is expected that each call creates a fresh channel.
The default implementation returns
Channels.newChannel(OutputStream)with the result ofgetOutputStream().- 返回:
- 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- 从以下版本开始:
- 5.0
- 另请参阅:
-