@FunctionalInterface public interface LastModifiedCallback
| Modifier and Type | Method and Description |
|---|---|
default void |
onEnd(LastModifiedSummary summary)
Called after the final
file's last modification has been streamed. |
boolean |
onFile(String file,
Commit commit)
Receives a fully-populated
commit which last modified the specified file. |
default void |
onStart(LastModifiedContext context)
Called before the first
file is streamed. |
default void onEnd(@Nonnull LastModifiedSummary summary) throws IOException
file's last modification has been streamed.
Note: If the requested path contained no files, this method may be called
immediately after onStart(LastModifiedContext) without any calls to onFile(String, Commit).
summary - summarizes the request and provides the most recent commit to modify the requested pathIOException - for implementations which perform I/Oboolean onFile(@Nonnull String file, @Nonnull Commit commit) throws IOException
commit which last modified the specified file. Files are
provided as relative to the requested path, and only files
are provided. Subdirectories of the requested path are not streamed.
This method will never be invoked before onStart(LastModifiedContext), and if it is invoked
onEnd(LastModifiedSummary) is guaranteed to be invoked, whether the end happens because this
method returns false or because the upstream sender runs out of modifications.
file - a relative path to the modified filecommit - the last commit to modify the filetrue if more modifications should be provided; otherwise, false to end streaming,
potentially leaving some number of modifications unreadIOException - for implementations which perform I/Odefault void onStart(@Nonnull LastModifiedContext context) throws IOException
file is streamed.context - provides details about the requestIOException - for implementations which perform I/OCopyright © 2019 Atlassian. All rights reserved.