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
FileContentCallback
line
was streamed, this
method will be called before FileContentCallback.onEnd(FileSummary)
to provide blame
for the streamed
lines.offerBlame
in interface FileContentCallback
blames
- blame
for the streamed linesIOException
- may be thrown by implementations which perform I/O.public void onBinary() throws IOException
FileContentCallback
onBinary
in interface FileContentCallback
IOException
- if the callback failspublic void onEnd(@Nonnull FileSummary summary) throws IOException
FileContentCallback
line
, 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 FileContentCallback
summary
- 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 FileContentCallback
lineNumber
- 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 truncatedtrue
IOException
- may be thrown by derived classespublic void onStart(@Nonnull FileContext context) throws IOException
FileContentCallback
FileContentCallback.onLine(int, String, boolean)
.onStart
in interface FileContentCallback
context
- 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.