Can't copy file mentioned in @ConcordionResources error

5 views
Skip to first unread message

Toby Weston

unread,
Mar 25, 2019, 3:07:51 PM3/25/19
to concordion
Hi Folks,


I intermittently get failures where the resource mentioned by @ConcordionResources can't be found. 

It feels like something isn't copying the files over as part of the build cycle (the file in question exists in src but not in the /tmp folder).

My friend can reproduce this every time (on a linux machine) and I see it every so often on a Mac (where it seems to fix itself).

Any ideas?

Thanks in advance,
Toby

Nigel Charman

unread,
Mar 27, 2019, 1:20:10 AM3/27/19
to conco...@googlegroups.com
Hi Toby

Thanks for reporting this.

I've reproduced it by removing the target folder as you stated in StackOverflow. The problem is that the FileTarget#createOutputStream(Resource) method is unable to create an OutputStream.

Assuming your fixture is in the a.b.c package, Concordion is trying to create an OutputStream for the file "<concordion.output.dir>/a/b/c/../../../concordion.css" (where <concordion.output.dir> is the concordion output directory). If the "<concordion.output.dir>/a/b/c/" folder does not already exist this fails - it seems that Java does not automatically "normalize" the path to remove ".."s.

The solution will be to normalize the path (probably using Path.normalize()).

To resolve, you can either update to the 2.2.1 release which should be available soon, or use absolute paths (eg. @ConcordionResources("/concordion.css")).

Nigel
--
You received this message because you are subscribed to the Google Groups "concordion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to concordion+...@googlegroups.com.
To post to this group, send email to conco...@googlegroups.com.
Visit this group at https://groups.google.com/group/concordion.
To view this discussion on the web, visit https://groups.google.com/d/msgid/concordion/a0d205f5-5512-430f-85ad-d032fc8062be%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nigel Charman

unread,
Mar 27, 2019, 2:20:07 AM3/27/19
to conco...@googlegroups.com
Sorry, the release will take longer and won't just be a patch release - we're going to need to update to Java 7 for Path.normalize().

Toby Weston

unread,
Mar 27, 2019, 2:28:22 PM3/27/19
to concordion
Thanks for looking and fixing things up!
Reply all
Reply to author
Forward
0 new messages