com.atlassian.stash.content.FileContentCallback2 |
Known Indirect Subclasses
|
Class Overview
FileContentCallback2
replaces the following methods:
These changes are intended to make this callback more consistent with the other callbacks, and to provide new
data to the callback while simplifying future changes to add even more data should they become necessary. The
new
FileContext
provided to
onStart
, for example, offers insight into the
shape of the file request for which content is being streamed and is designed to allow adding new context data
in the future without requiring further changes to callback implementations.
Warning: The semantics of
blame
were changed slightly in Stash 2.10. Previously
appendBlame(List)
was called
after onEndPage(Page)
. For 2.10+,
offerBlame(List)
is now called
before onEnd(FileSummary)
. This makes
onEnd(FileSummary)
's behaviour
consistent with other callbacks; it is always intended to be the
final callback method to be invoked,
indicating there is no further data available so that callback implementations can wrap up their processing.
Note: This interface is
transitional and will be folded back into
FileContentCallback
in Stash 3.0.
Implementors are
strongly encouraged to extend from
AbstractFileContentCallback
. This interface
will change over time, and any class implementing it directly will be broken by those changes. Extending
from the abstract class will help minimize such breakages.
Public Methods
public
void
offerBlame
(List<? extends Blame> blames)
If annotations were requested and at least one line
was streamed, this
method will be called before onEnd(FileSummary)
to provide blame
for the streamed
lines.
Warning: The semantics of this method were changed slightly in Stash 2.10. In previous releases it was
called
after onEndPage(Page)
. It is now called
before onEnd(FileSummary)
. This
makes
onEnd(FileSummary)
's handling consistent with other callbacks; it is always intended to be the
final callback method to be invoked, indicating there is no further data available.
Parameters
blames
| blame for the streamed lines |
Throws
IOException
| May be thrown by implementations which perform I/O.
|
public
void
onEnd
(FileSummary summary)
Parameters
summary
| summarizes the file request and the streamed lines |
Throws
IOException
| may be thrown by implementations which perform I/O.
|
public
void
onStart
(FileContext context)
Parameters
context
| provides details about the file request for which lines are being streamed |
Throws
IOException
| may be thrown by implementations which perform I/O.
|