1 16 package org.apache.commons.vfs.impl; 17 18 import java.io.IOException ; 19 import java.net.MalformedURLException ; 20 import java.net.URL ; 21 import java.net.URLConnection ; 22 import java.net.URLStreamHandler ; 23 24 29 class URLStreamHandlerProxy 30 extends URLStreamHandler 31 { 32 protected URLConnection openConnection(final URL url) 33 throws IOException 34 { 35 final URL proxyURL = new URL (url.toExternalForm()); 36 return proxyURL.openConnection(); 37 } 38 39 protected void parseURL(final URL u, 40 final String spec, 41 final int start, 42 final int limit) 43 { 44 try 45 { 46 final URL url = new URL (u, spec); 47 setURL(u, url.getProtocol(), url.getHost(), 48 url.getPort(), url.getAuthority(), url.getUserInfo(), 49 url.getFile(), url.getQuery(), url.getRef()); 50 } 51 catch (MalformedURLException mue) 52 { 53 throw new RuntimeException (mue.getMessage()); 56 } 57 } 58 } 59 | Popular Tags |