Package libcore.net.url
Class FtpHandler
java.lang.Object
java.net.URLStreamHandler
libcore.net.url.FtpHandler
public class FtpHandler extends URLStreamHandler
-
Constructor Summary
Constructors Constructor Description FtpHandler() -
Method Summary
Modifier and Type Method Description protected intgetDefaultPort()Return the default port.protected URLConnectionopenConnection(URL u)Open a URLConnection on the given URL.protected URLConnectionopenConnection(URL url, Proxy proxy)Returns a connection, which is established via theproxy, to the FTP server specified by thisURL.Methods inherited from class java.net.URLStreamHandler
equals, getHostAddress, hashCode, hostsEqual, parseURL, sameFile, setURL, setURL, toExternalForm
-
Constructor Details
-
FtpHandler
public FtpHandler()
-
-
Method Details
-
openConnection
Open a URLConnection on the given URL.- Specified by:
openConnectionin classURLStreamHandler- Parameters:
u- the URL to the resource where a connection has to be opened.- Returns:
- the opened URLConnection to the specified resource.
- Throws:
IOException- if an I/O error occurs during opening the connection.
-
openConnection
Returns a connection, which is established via theproxy, to the FTP server specified by thisURL. Ifproxyis DIRECT type, the connection is made in normal way.- Overrides:
openConnectionin classURLStreamHandler- Parameters:
url- the URL which the connection is pointing toproxy- the proxy which is used to make the connection- Returns:
- a connection to the resource pointed by this url.
- Throws:
IOException- if this handler fails to establish a connection.IllegalArgumentException- if any argument is null or the type of proxy is wrong.UnsupportedOperationException- if the protocol handler doesn't support this method.
-
getDefaultPort
protected int getDefaultPort()Return the default port.- Overrides:
getDefaultPortin classURLStreamHandler
-