Package com.atlassian.bitbucket.commit
Interface LastModifiedCallback
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Describes a callback for receiving the commits that last modified a set of files.
- Since:
- 4.6
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
onEnd
(LastModifiedSummary summary) Called after the finalfile
's last modification has been streamed.boolean
Receives a fully-populatedcommit
which last modified the specifiedfile
.default void
onStart
(LastModifiedContext context) Called before the firstfile
is streamed.
-
Method Details
-
onEnd
Called after the finalfile
's last modification has been streamed.Note: If the
requested path
contained no files, this method may be called immediately afteronStart(LastModifiedContext)
without any calls toonFile(String, Commit)
.- Parameters:
summary
- summarizes the request and provides the most recent commit to modify the requested path- Throws:
IOException
- for implementations which perform I/O
-
onFile
Receives a fully-populatedcommit
which last modified the specifiedfile
. Files are provided as relative to therequested 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 invokedonEnd(LastModifiedSummary)
is guaranteed to be invoked, whether the end happens because this method returnsfalse
or because the upstream sender runs out of modifications.- Parameters:
file
- a relative path to the modified filecommit
- the last commit to modify the file- Returns:
true
if more modifications should be provided; otherwise,false
to end streaming, potentially leaving some number of modifications unread- Throws:
IOException
- for implementations which perform I/O
-
onStart
Called before the firstfile
is streamed.- Parameters:
context
- provides details about the request- Throws:
IOException
- for implementations which perform I/O
-