Interface WritableResource
-
- All Superinterfaces:
InputStreamSource,Resource
- All Known Implementing Classes:
FileSystemResource,PathResource
public interface WritableResource extends Resource
Extended interface for a resource that supports writing to it. Provides anOutputStream accessor.- Since:
- 3.1
- Author:
- Juergen Hoeller
- See Also:
OutputStream
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description OutputStreamgetOutputStream()Return anOutputStreamfor the underlying resource, allowing to (over-)write its content.booleanisWritable()Return whether the contents of this resource can be modified, e.g. viagetOutputStream()orResource.getFile().-
Methods inherited from interface org.hotswap.agent.util.spring.io.resource.InputStreamSource
getInputStream
-
Methods inherited from interface org.hotswap.agent.util.spring.io.resource.Resource
contentLength, createRelative, exists, getDescription, getFile, getFilename, getURI, getURL, isOpen, isReadable, lastModified
-
-
-
-
Method Detail
-
isWritable
boolean isWritable()
Return whether the contents of this resource can be modified, e.g. viagetOutputStream()orResource.getFile().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.- See Also:
getOutputStream(),Resource.isReadable()
-
getOutputStream
OutputStream getOutputStream() throws IOException
Return anOutputStreamfor the underlying resource, allowing to (over-)write its content.- Throws:
IOException- if the stream could not be opened- See Also:
InputStreamSource.getInputStream()
-
-