[jira] [Updated] (TREQ-20) NoSuchDefinitionException When tiles.xml in a path containing white space

2014-09-06 Thread Leonardo Piedade (JIRA)

 [ 
https://issues.apache.org/jira/browse/TREQ-20?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Leonardo Piedade updated TREQ-20:
-
Attachment: URLApplicationResource.java

My suggestion to fix this is:

on URLApplicationResource, change line 80:

{code}
public InputStream getInputStream() throws IOException {
if (file != null) {
return new FileInputStream(file);
} else {
return url.openConnection().getInputStream();
}
}
{code}

to:
{code}
public InputStream getInputStream() throws IOException {
if (file != null) {
return new 
FileInputStream(URLDecoder.decode(file.getAbsolutePath(),Charset.defaultCharset().name()));
} else {
return url.openConnection().getInputStream();
}
}
{code}

 NoSuchDefinitionException When tiles.xml in a path containing white space
 -

 Key: TREQ-20
 URL: https://issues.apache.org/jira/browse/TREQ-20
 Project: Tiles Request
  Issue Type: Bug
Affects Versions: 1.0.5
 Environment: Windows 7 86_64x (NTFS). Running on WebSphere Liberty 
 Profile (WLP) Application Server.
Reporter: Leonardo Piedade
Assignee: Nicolas Le Bas
 Fix For: 1.0.6

 Attachments: URLApplicationResource.java


 when running tiles.xml in a file path, which contains white spaces (such as 
 c:\My Projects), a NoSuchDefinitionException  is thrown. If I remove white 
 spaces, the exception is gone.
 The white spaces are converted to %20 (C:\My%20Projects).
 For me, the problem is in package org.apache.tiles.definition.dao, on class 
 BaseLocaleUrlDefinitionDAO, line 149: stream = resource.getInputStream();
 {code}
 protected MapString, Definition 
 loadDefinitionsFromResource(ApplicationResource resource) {
 MapString, Definition defsMap = null;
 InputStream stream = null;
 try {
 lastModifiedDates.put(resource.getLocalePath(), resource
 .getLastModified());
 // Definition must be collected, starting from the base
 // source up to the last localized file.
 stream = resource.getInputStream();
 defsMap = reader.read(stream);
 } catch (FileNotFoundException e) {
 ..
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (TREQ-20) NoSuchDefinitionException When tiles.xml in a path containing white space

2014-09-05 Thread Nicolas Le Bas (JIRA)

 [ 
https://issues.apache.org/jira/browse/TREQ-20?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nicolas Le Bas updated TREQ-20:
---
Labels:   (was: easyfix patch)

 NoSuchDefinitionException When tiles.xml in a path containing white space
 -

 Key: TREQ-20
 URL: https://issues.apache.org/jira/browse/TREQ-20
 Project: Tiles Request
  Issue Type: Bug
Affects Versions: 1.0.5
 Environment: Windows 7 86_64x (NTFS). Running on WebSphere Liberty 
 Profile (WLP) Application Server.
Reporter: Leonardo Piedade

 when running tiles.xml in a file path, which contains white spaces (such as 
 c:\My Projects), a NoSuchDefinitionException  is thrown. If I remove white 
 spaces, the exception is gone.
 The white spaces are converted to %20 (C:\My%20Projects).
 For me, the problem is in package org.apache.tiles.definition.dao, on class 
 BaseLocaleUrlDefinitionDAO, line 149: stream = resource.getInputStream();
 {code}
 protected MapString, Definition 
 loadDefinitionsFromResource(ApplicationResource resource) {
 MapString, Definition defsMap = null;
 InputStream stream = null;
 try {
 lastModifiedDates.put(resource.getLocalePath(), resource
 .getLastModified());
 // Definition must be collected, starting from the base
 // source up to the last localized file.
 stream = resource.getInputStream();
 defsMap = reader.read(stream);
 } catch (FileNotFoundException e) {
 ..
 {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)