Class FtpHandler

java.lang.Object
java.net.URLStreamHandler
libcore.net.url.FtpHandler

public class FtpHandler
extends URLStreamHandler
  • Constructor Details

    • FtpHandler

      public FtpHandler()
  • Method Details

    • openConnection

      protected URLConnection openConnection​(URL u) throws IOException
      Open a URLConnection on the given URL.
      Specified by:
      openConnection in class URLStreamHandler
      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

      protected URLConnection openConnection​(URL url, Proxy proxy) throws IOException
      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.
      Overrides:
      openConnection in class URLStreamHandler
      Parameters:
      url - the URL which the connection is pointing to
      proxy - 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:
      getDefaultPort in class URLStreamHandler