FileDocCategorySizeDatePackage
Handler.javaAPI DocAndroid 1.5 API2543Wed May 06 22:41:04 BST 2009org.apache.harmony.luni.internal.net.www.protocol.ftp

Handler

public class Handler extends URLStreamHandler

Fields Summary
Constructors Summary
Methods Summary
protected intgetDefaultPort()
Return the default port.

        return 21;
    
protected java.net.URLConnectionopenConnection(java.net.URL u)
Open a URLConnection on the given URL.

        return new FtpURLConnection(u);
    
protected java.net.URLConnectionopenConnection(java.net.URL u, java.net.Proxy proxy)
Returns a connection, which is established via the proxy, to the FTP server specified by this URL. If proxy is DIRECT type, the connection is made in normal way.

param
u the URL which the connection is pointing to
param
proxy the proxy which is used to make the connection
return
a connection to the resource pointed by this url.
throws
IOException if this handler fails to establish a connection.
throws
IllegalArgumentException if any argument is null or the type of proxy is wrong.
throws
UnsupportedOperationException if the protocol handler doesn't support this method.

        if (null == u || null == proxy) {
            throw new IllegalArgumentException(Msg.getString("K034b")); //$NON-NLS-1$
        }
        return new FtpURLConnection(u, proxy);