public class AbstractFileContentCallback extends Object implements FileContentCallback
| Constructor and Description |
|---|
AbstractFileContentCallback() |
| Modifier and Type | Method and Description |
|---|---|
void |
offerBlame(Page<Blame> blames)
If annotations were requested and at least one
line was streamed, this
method will be called before FileContentCallback.onEnd(FileSummary) to provide blame for the streamed
lines. |
void |
onBinary()
Called once if the file is binary.
|
void |
onEnd(FileSummary summary)
|
boolean |
onLine(int lineNumber,
String line,
boolean truncated)
Ignores the provided line details and returns
true, which will continue streaming. |
void |
onStart(FileContext context)
Called before the first
FileContentCallback.onLine(int, String, boolean). |
public void offerBlame(@Nonnull Page<Blame> blames) throws IOException
FileContentCallbackline was streamed, this
method will be called before FileContentCallback.onEnd(FileSummary) to provide blame for the streamed
lines.offerBlame in interface FileContentCallbackblames - blame for the streamed linesIOException - may be thrown by implementations which perform I/O.public void onBinary()
throws IOException
FileContentCallbackonBinary in interface FileContentCallbackIOException - if the callback failspublic void onEnd(@Nonnull FileSummary summary) throws IOException
FileContentCallbackline, and blame if
requested, has been streamed.
Note: If there were no lines, this method may be called immediately after FileContentCallback.onStart(FileContext) without
any calls to FileContentCallback.onLine(int, String, boolean).
onEnd in interface FileContentCallbacksummary - summarizes the file request and the streamed linesIOException - may be thrown by implementations which perform I/O.public boolean onLine(int lineNumber,
String line,
boolean truncated)
throws IOException
true, which will continue streaming.onLine in interface FileContentCallbacklineNumber - the line number of the line in the fileline - a truncated line of code. The line character limit can be set at a system level via a system propertytruncated - where the received line was truncatedtrueIOException - may be thrown by derived classespublic void onStart(@Nonnull FileContext context) throws IOException
FileContentCallbackFileContentCallback.onLine(int, String, boolean).onStart in interface FileContentCallbackcontext - provides details about the file request for which lines are being streamedIOException - may be thrown by implementations which perform I/O.Copyright © 2019 Atlassian. All rights reserved.