public interface FileContentCallback
Note: Implementors are strongly encouraged to extend from AbstractFileContentCallback
. This interface
will change, over time, and any class implementing it directly will be broken by such changes. Extending from
the abstract class will help prevent such breakages.
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 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)
Called once for each line in the file.
|
void |
onStart(FileContext context)
Called before the first
onLine(int, String, boolean) . |
void offerBlame(@Nonnull Page<Blame> blames) throws IOException
line
was streamed, this
method will be called before onEnd(FileSummary)
to provide blame
for the streamed
lines.blames
- blame
for the streamed linesIOException
- may be thrown by implementations which perform I/O.void onBinary() throws IOException
IOException
- if the callback failsvoid onEnd(@Nonnull FileSummary summary) throws IOException
line
, and blame
if
requested, has been streamed.
Note: If there were no lines, this method may be called immediately after onStart(FileContext)
without
any calls to onLine(int, String, boolean)
.
summary
- summarizes the file request and the streamed linesIOException
- may be thrown by implementations which perform I/O.boolean onLine(int lineNumber, String line, boolean truncated) throws IOException
onStart(FileContext)
is called before any invocation of this
method. onEnd(FileSummary)
is called after all invocations of this method.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
if additional lines should be provided; otherwise, false
if sufficient lines have
been processedIOException
- if the callback failsvoid onStart(@Nonnull FileContext context) throws IOException
onLine(int, String, boolean)
.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.