Here you can find the source of normalizeUrl(URL url)
public static URL normalizeUrl(URL url) throws IOException
//package com.java2s; /*//from w w w .j a v a2 s . c o m * This file is part of VirtualFile. * * Copyright 2016 by Bernd Riedl <bernd.riedl@gmail.com> * * Licensed under GNU Lesser General Public License 3.0 or later. * Some rights reserved. See COPYING, AUTHORS. */ import java.io.IOException; import java.net.URI; import java.net.URL; public class Main { public static URL normalizeUrl(URL url) throws IOException { URI uri = URI.create(url.toString()); return uri.normalize().toURL(); } }