You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by iv...@apache.org on 2008/10/31 00:51:10 UTC

svn commit: r709295 - /wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/link/DownloadLink.java

Author: ivaynberg
Date: Thu Oct 30 16:51:10 2008
New Revision: 709295

URL: http://svn.apache.org/viewvc?rev=709295&view=rev
Log:
WICKET-1115

Modified:
    wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/link/DownloadLink.java

Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/link/DownloadLink.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/link/DownloadLink.java?rev=709295&r1=709294&r2=709295&view=diff
==============================================================================
--- wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/link/DownloadLink.java (original)
+++ wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/link/DownloadLink.java Thu Oct 30 16:51:10 2008
@@ -21,6 +21,7 @@
 import org.apache.wicket.RequestCycle;
 import org.apache.wicket.model.IModel;
 import org.apache.wicket.model.Model;
+import org.apache.wicket.protocol.http.WicketURLEncoder;
 import org.apache.wicket.request.target.resource.ResourceStreamRequestTarget;
 import org.apache.wicket.util.resource.FileResourceStream;
 import org.apache.wicket.util.resource.IResourceStream;
@@ -140,7 +141,9 @@
 			throw new IllegalStateException(getClass().getName() +
 				" failed to retrieve a File object from model");
 		}
-		final String fn = (fileName != null) ? fileName : file.getName();
+		final String fn = WicketURLEncoder.QUERY_INSTANCE.encode((fileName != null) ? fileName
+			: file.getName());
+
 
 		IResourceStream resourceStream = new FileResourceStream(
 			new org.apache.wicket.util.file.File(file));