Package org.apache.maven.index.reader
Interface WritableResourceHandler.WritableResource
-
- All Superinterfaces:
java.lang.AutoCloseable
,java.io.Closeable
,ResourceHandler.Resource
- Enclosing interface:
- WritableResourceHandler
public static interface WritableResourceHandler.WritableResource extends ResourceHandler.Resource, java.io.Closeable
Resource that is writable.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.io.OutputStream
write()
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
read
-
-
-
-
Method Detail
-
write
java.io.OutputStream write() throws java.io.IOException
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 byCloseable.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:
java.io.IOException
-
-