From 35d5555acc0ee672bd04b2abc527e6df7bb90e2c Mon Sep 17 00:00:00 2001 From: Vladimir Plizga Date: Thu, 21 May 2020 20:40:41 +0700 Subject: [PATCH] GH-3286: Make FileTailingEvent#getMessage public Fixes https://github.com/spring-projects/spring-integration/issues/3286 The `FileTailingEvent.getMessage()` is really meant to be as `public` **Cherry-pick to 5.3.x, 5.2.x, 5.1.x & 4.3.x** # Conflicts: # spring-integration-file/src/main/java/org/springframework/integration/file/tail/FileTailingMessageProducerSupport.java --- .../tail/FileTailingMessageProducerSupport.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/tail/FileTailingMessageProducerSupport.java b/spring-integration-file/src/main/java/org/springframework/integration/file/tail/FileTailingMessageProducerSupport.java index e64e59a79e..fe671f32c7 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/tail/FileTailingMessageProducerSupport.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/tail/FileTailingMessageProducerSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,6 +32,7 @@ import org.springframework.util.Assert; * Base class for file tailing inbound adapters. * * @author Gary Russell + * @author Vladimir Plizga * @since 3.0 * */ @@ -130,7 +131,15 @@ public abstract class FileTailingMessageProducerSupport extends MessageProducerS this.file = file; } - protected String getMessage() { + /** + * Return the text message emitted from the underlying tailing producer + * ({@linkplain ApacheCommonsFileTailingMessageProducer Apache Commons} or one of + * {@linkplain OSDelegatingFileTailingMessageProducer OS natives}). + *

Note that for the same event type (e.g. 'file not found') the text may be different + * depending on the producer and its platform. + * @return the original text of the tailing event + */ + public String getMessage() { return this.message; }