You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Hartmut Obendorf (JIRA)" <ji...@codehaus.org> on 2010/04/22 14:05:19 UTC
[jira] Commented: (MPMD-121) Download of PMD ruleset from URL fails
if URL contains characters not valid in file name
[ http://jira.codehaus.org/browse/MPMD-121?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=218591#action_218591 ]
Hartmut Obendorf commented on MPMD-121:
---------------------------------------
error occurs in class
org.apache.maven.plugin.pmd.PMDReport
> Download of PMD ruleset from URL fails if URL contains characters not valid in file name
> ----------------------------------------------------------------------------------------
>
> Key: MPMD-121
> URL: http://jira.codehaus.org/browse/MPMD-121
> Project: Maven 2.x PMD Plugin
> Issue Type: Bug
> Components: PMD
> Affects Versions: 2.4
> Environment: win32
> Reporter: Hartmut Obendorf
>
> private String getLocationTemp( String name )
> {
> String loc = name;
> if ( loc.indexOf( '/' ) != -1 )
> {
> loc = loc.substring( loc.lastIndexOf( '/' ) + 1 );
> }
> if ( loc.indexOf( '\\' ) != -1 )
> {
> loc = loc.substring( loc.lastIndexOf( '\\' ) + 1 );
> }
> getLog().debug( "Before: " + name + " After: " + loc );
> return loc;
> }
> should encode the URL, so that characters such as ? or & do not prevent creating a local file
> Fix suggestion: add following code line before log output:
> loc = URLEncoder.encode(loc, "UTF-8");
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira