Build: #21 was successful Scheduled with changes by Artem Bilan

Code commits

Plan Repository

  • Artem Bilan

    Artem Bilan 0d7bbeaa4e1a202e9d12de5faaaea93b08412bb7

    GH-3554: Eval remote dir on each synchToLocal (#3556)
    * GH-3554: Eval remote dir on each synchToLocal


    The `remoteDirectoryExpression` was introduced into an
    `AbstractInboundFileSynchronizer` to let end-user to evaluate a remote directory
    on each poll (essentially on each `synchronizeToLocalDirectory()` call).
    The fix for the introduced a regression
    when such an expression was evaluated only once when we call a `setRemoteDirectory()`.
    So, an original purpose of this option was lost and we don't get an actual
    remote dir on each poll

    * Remove `evaluateRemoteDirectory()` method and its usage since it doesn't
    reflect expectation of the remote dir expression property
    * Reinstate the `remoteDirectoryExpression` evaluation in the
    * Propagate the result of that expression into further methods for copying
    * Remove setting of the `remoteDirectory` variable into a global `EvaluationContext`
    of the `AbstractInboundFileSynchronizer` instance since it is not thread-safe
    * Instead create an `EvaluationContext` locally for each `synchronizeToLocalDirectory()`
    call and set the `remoteDirectory` variable into this scoped instances
    * Generate a local file name from the `localFilenameGeneratorExpression`
    against locally created `EvaluationContext` with the mentioned `remoteDirectory` variable
    * Cover the expected functionality with a unit-test

    **Cherry-pick to `5.4.x` & `5.3.x`**

    * * Fix `testRemoteDirectoryRefreshedOnEachSynchronization` according PR review

    • spring-integration-file/src/main/java/org/springframework/integration/file/remote/synchronizer/ (version 0d7bbeaa4e1a202e9d12de5faaaea93b08412bb7)
    • spring-integration-file/src/test/java/org/springframework/integration/file/remote/synchronizer/ (version 0d7bbeaa4e1a202e9d12de5faaaea93b08412bb7)
    • spring-integration-ftp/src/test/java/org/springframework/integration/ftp/config/ (version 0d7bbeaa4e1a202e9d12de5faaaea93b08412bb7)