maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bentm...@apache.org
Subject svn commit: r651407 - /maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/SiteStageMojo.java
Date Thu, 24 Apr 2008 20:33:49 GMT
Author: bentmann
Date: Thu Apr 24 13:33:47 2008
New Revision: 651407

URL: http://svn.apache.org/viewvc?rev=651407&view=rev
Log:
[MSITE-303] Discard invalid characters from directory name generated for staging site

Modified:
    maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/SiteStageMojo.java

Modified: maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/SiteStageMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/SiteStageMojo.java?rev=651407&r1=651406&r2=651407&view=diff
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/SiteStageMojo.java
(original)
+++ maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/SiteStageMojo.java
Thu Apr 24 13:33:47 2008
@@ -155,16 +155,17 @@
         }
 
         Repository repository = new Repository( site.getId(), site.getUrl() );
-        if ( StringUtils.isEmpty( repository.getBasedir() ) )
+        StringBuffer hierarchy = new StringBuffer( 1024 );
+        hierarchy.append( repository.getHost() );
+        if ( !StringUtils.isEmpty( repository.getBasedir() ) )
         {
-            return repository.getHost();
+            if ( !repository.getBasedir().startsWith( "/" ) )
+            {
+                hierarchy.append( '/' );
+            }
+            hierarchy.append( repository.getBasedir() );
         }
 
-        if ( repository.getBasedir().startsWith( "/" ) )
-        {
-            return repository.getHost() + repository.getBasedir();
-        }
-
-        return repository.getHost() + "/" + repository.getBasedir();
+        return hierarchy.toString().replaceAll( "[\\:\\?\\*]", "" );
     }
 }



Mime
View raw message