Skip to content

INT-3494: Resolve dir for writing as a Resource #3109

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 14, 2019

Conversation

artembilan
Copy link
Member

JIRA: https://jira.spring.io/browse/INT-3494

The expression for local directory can be resolved into a Resource
or resource location.

  • Fix ExpressionUtils.expressionToFile() to support Resource and
    also use ResourceUtils.getFile(path) when expression result is a string
  • Modify tests to ensure that resource is resolved properly
  • Upgrade affected tests to JUnit 5
  • Mention an new functionality in docs

JIRA: https://jira.spring.io/browse/INT-3494

The expression for local directory can be resolved into a `Resource`
or resource location.
* Fix `ExpressionUtils.expressionToFile()` to support `Resource` and
also use `ResourceUtils.getFile(path)` when expression result is a string
* Modify tests to ensure that resource is resolved properly
* Upgrade affected tests to JUnit 5
* Mention an new functionality in docs
Copy link
Contributor

@garyrussell garyrussell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, in future, unless there are only one or two tests, we should perform JUnit5 conversion in a separate PR (or at least a separate commit) to make it easier to review.

@@ -168,29 +172,49 @@ private static EvaluationContext createEvaluationContext(@Nullable ConversionSer
public static File expressionToFile(Expression expression, EvaluationContext evaluationContext,
@Nullable Message<?> message, String name) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should take this opportunity to improve the javadocs for the name parameter.

@param name the name of the result of the evaluation.

@param name the name of the property we are evaluating an expression for ?

@artembilan
Copy link
Member Author

or at least a separate commit

Yeah... That's my flaw: I can't stay away if I see that code should be refactored 😄

Will work on that habit for future tasks!

* Finish the sentence in the `file.adoc`
@garyrussell garyrussell merged commit 0f5bd4a into spring-projects:master Nov 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants