drools-eclipse/org.guvnor.eclipse.webdav/src/interface/org/eclipse/webdav/internal/utils/URLEncoder.java
public static URL encode(URL url) {
        String file = url.getFile();
        String ref = url.getRef();

        try {
            return new URL(url.getProtocol(), url.getHost(), url.getPort(), encode(file, ref));
        } catch (MalformedURLException e) {
            Assert.isTrue(false, Policy.bind("assert.internalError")); //$NON-NLS-1$
        }

        return null;
    }
public static URL encode(URL url) {
        String file = url.getFile();
        String ref = url.getRef();

        try {
            return new URL(url.getProtocol(), url.getHost(), url.getPort(), encode(file, ref));
        } catch (MalformedURLException e) {
            Assert.isTrue(false, Policy.bind("assert.internalError")); //$NON-NLS-1$
        }

        return null;
    }
Encodes the given <code>URL</code> into an <code>ASCII</code>
readable <code>URL</code> that is safe for transport. Returns the
result.

@return the result of encoding the given <code>URL</code> into an
<code>ASCII</code> readable <code>URL</code> that is safe for
transport