URL eurl = urls.nextElement(); String urlPath = eurl.getProtocol() + ":" + URLEncoder.encode(eurl.getPath(), "UTF-8"); eurl = new URL(urlPath);