Interface WritableResourceHandler.WritableResource

All Superinterfaces:
AutoCloseable, Closeable, ResourceHandler.Resource
All Known Implementing Classes:
BufferedWritableResource, PathWritableResource
Enclosing interface:
WritableResourceHandler

public static interface WritableResourceHandler.WritableResource extends ResourceHandler.Resource
Resource that is writable.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the OutputStream 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

      OutputStream write() throws IOException
      Returns the OutputStream 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 by ResourceHandler.Resource.close() on the resource itself. Implementation does not have to be "read consistent", in a way to worry what subsequent ResourceHandler.Resource.read() method will return, as mixed calls will not happen on same instance of resource.
      Throws:
      IOException