Skip to content

Commit e76397c

Browse files
committed
Removed added method from interface that broke binary compatibility.
Clients wishing to use this feature must subclass TailerListenerAdapter until we break compatibility or go java8 minumum. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/io/trunk@1714076 13f79535-47bb-0310-9956-ffa450edef68
1 parent b9c2c11 commit e76397c

3 files changed

Lines changed: 9 additions & 8 deletions

File tree

src/main/java/org/apache/commons/io/input/Tailer.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,9 @@ private long readLines(final RandomAccessFile reader) throws IOException {
550550
IOUtils.closeQuietly(lineBuf); // not strictly necessary
551551
reader.seek(rePos); // Ensure we can re-read if necessary
552552

553-
listener.endOfFileReached();
553+
if (listener instanceof TailerListenerAdapter) {
554+
((TailerListenerAdapter) listener).endOfFileReached();
555+
}
554556

555557
return rePos;
556558
}

src/main/java/org/apache/commons/io/input/TailerListener.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,4 @@ public interface TailerListener {
6464
*/
6565
void handle(Exception ex);
6666

67-
/**
68-
* Called each time the Tailer reaches the end of the file.
69-
* <p>
70-
* <b>Note:</b> this is called from the tailer thread.
71-
* @since 2.5
72-
*/
73-
void endOfFileReached();
7467
}

src/main/java/org/apache/commons/io/input/TailerListenerAdapter.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ public void handle(final Exception ex) {
6363

6464
/**
6565
* Called each time the Tailer reaches the end of the file.
66+
*
67+
* <b>Note:</b> this is called from the tailer thread.
68+
*
69+
* Note: a future version of commons-io will pull this method up to the TailerListener interface,
70+
* for now clients must subclass this class to use this feature.
71+
*
6672
* @since 2.5
6773
*/
6874
public void endOfFileReached() {

0 commit comments

Comments
 (0)