Author: maartenc Date: Tue Aug 5 15:45:50 2008 New Revision: 683017 URL: http://svn.apache.org/viewvc?rev=683017&view=rev Log: Attempt to fix IVY-652
Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/url/URLRepository.java Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/url/URLRepository.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/url/URLRepository.java?rev=683017&r1=683016&r2=683017&view=diff ============================================================================== --- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/url/URLRepository.java (original) +++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/url/URLRepository.java Tue Aug 5 15:45:50 2008 @@ -40,6 +40,7 @@ private Map resourcesCache = new HashMap(); public Resource getResource(String source) throws IOException { + source = encode(source); Resource res = (Resource) resourcesCache.get(source); if (res == null) { res = new URLResource(new URL(source)); @@ -47,6 +48,11 @@ } return res; } + + private static String encode(String source) { + // TODO: add some more URL encodings here + return source.trim().replaceAll(" ", "%20"); + } public void get(String source, File destination) throws IOException { fireTransferInitiated(getResource(source), TransferEvent.REQUEST_GET);