接口 WritableResource
- 所有超级接口:
InputStreamSource
,Resource
- 所有已知实现类:
FileSystemResource
,PathResource
public interface WritableResource extends Resource
Extended interface for a resource that supports writing to it. Provides anOutputStream accessor
.- 从以下版本开始:
- 3.1
- 作者:
- Juergen Hoeller
- 另请参阅:
OutputStream
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 OutputStream
getOutputStream()
Return anOutputStream
for the underlying resource, allowing to (over-)write its content.boolean
isWritable()
Return whether the contents of this resource can be modified, e.g. viagetOutputStream()
orResource.getFile()
.从接口继承的方法 org.springframework.core.io.InputStreamSource
getInputStream
从接口继承的方法 org.springframework.core.io.Resource
contentLength, createRelative, exists, getDescription, getFile, getFilename, getURI, getURL, isOpen, isReadable, lastModified
方法详细资料
isWritable
boolean isWritable()
Return whether the contents of this resource can be modified, e.g. viagetOutputStream()
orResource.getFile()
.Will be
true
for typical resource descriptors; note that actual content writing may still fail when attempted. However, a value offalse
is a definitive indication that the resource content cannot be modified.
getOutputStream
OutputStream getOutputStream() throws IOException
Return anOutputStream
for the underlying resource, allowing to (over-)write its content.- 抛出:
IOException
- if the stream could not be opened- 另请参阅:
InputStreamSource.getInputStream()