Package org.apache.maven.index.reader
Interface WritableResourceHandler.WritableResource
- All Superinterfaces:
AutoCloseable
,Closeable
,ResourceHandler.Resource
- All Known Implementing Classes:
BufferedWritableResource
,PathWritableResource
- Enclosing interface:
- WritableResourceHandler
Resource that is writable.
-
Method Summary
Modifier and TypeMethodDescriptionwrite()
Returns theOutputStream
stream of the resource, if exists, it will replace the existing content, or if not exists, the resource will be created.Methods inherited from interface org.apache.maven.index.reader.ResourceHandler.Resource
close, read
-
Method Details
-
write
Returns theOutputStream
stream of the resource, if exists, it will replace the existing content, or if not exists, the resource will be created. The stream should be closed by caller, otherwise resource leaks might be introduced. How and when content is written is left to implementation, but it is guaranteed that this method is called only once, and will be followed byResourceHandler.Resource.close()
on the resource itself. Implementation does not have to be "read consistent", in a way to worry what subsequentResourceHandler.Resource.read()
method will return, as mixed calls will not happen on same instance of resource.- Throws:
IOException
-