qickrooms / flex-mojos

Automatically exported from code.google.com/p/flex-mojos
0 stars 0 forks source link

templateURI doesn't support folder path which contains spaces #101

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
it complains error:
[INFO] Invalid template URI.
Embedded error: Illegal character in opaque part ....

Original issue reported on code.google.com by trung.nk...@gmail.com on 4 Sep 2008 at 12:41

GoogleCodeExporter commented 9 years ago
Where is this space?

Can you provide a sample?

VELO

Original comment by velo...@gmail.com on 4 Sep 2008 at 2:20

GoogleCodeExporter commented 9 years ago
when i declare: <templateURI>folder:${basedir}/../html-template</templateURI>

${basedir} = C:\Document and Settings\admin\...

Btw, is it the absolute path the templateURL resolves?

Original comment by trung.nk...@gmail.com on 5 Sep 2008 at 3:34

GoogleCodeExporter commented 9 years ago
Just ran into this exact problem and to solve it I encoded the templateURI 
using the
Apache commons httpclient URIUtil as follows.

templateURI = URIUtil.encodePath( templateURI );

Only draw back is this requires an additional dependency which I added to the 
pom as:
<dependency>
     <groupId>commons-httpclient</groupId>
     <artifactId>commons-httpclient</artifactId>
     <version>3.1</version>
</dependency>

I will admit my strong point (at the moment) is not Java so maybe there is a 
more
preferred way to encode strings that doesn't require the Apache library but 
this did
the trick for me. :-)

I have attached the three files I changed. (root POM, html-wrapper-mojo POM and
HtmlWrapperMojo.java)

Original comment by llin...@gmail.com on 4 Oct 2008 at 12:36

Attachments:

GoogleCodeExporter commented 9 years ago
Fixed at revision 785

Original comment by velo...@gmail.com on 8 Oct 2008 at 4:01