Class DittoAttachmentFetcher
java.lang.Object
com.ditto.java.DittoAttachmentFetcher
- All Implemented Interfaces:
Closeable,AutoCloseable
Manages the fetching of an attachment from remote peers.
These objects are returned by calls to DittoStore.fetchAttachment(DittoAttachmentToken).
The fetcher handles downloading attachment data from remote peers in the mesh network.
This class implements Closeable, so it can be used with try-with-resources
to ensure proper cleanup:
`try (DittoAttachmentFetcher fetcher = store.fetchAttachment(token, event ->{// Handle fetch events})){// Attachment fetch is in progress}// Fetcher is automatically closed and cleaned up`
-
Method Summary
-
Method Details
-
close
Stops fetching the associated attachment and cleans up any associated resources.
This should be called once you have completed an attachment fetch operation or before an attachment fetch has completed if you want to cancel the fetch operation.
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException- if an I/O error occurs during cleanup.
-
hashCode
-
equals
-
toString
-