src/java.base/share/classes/java/net/URLStreamHandlerFactory.java

Print this page




  27 
  28 /**
  29  * This interface defines a factory for {@code URL} stream
  30  * protocol handlers.
  31  * <p>
  32  * It is used by the {@code URL} class to create a
  33  * {@code URLStreamHandler} for a specific protocol.
  34  *
  35  * @author  Arthur van Hoff
  36  * @see     java.net.URL
  37  * @see     java.net.URLStreamHandler
  38  * @since   1.0
  39  */
  40 public interface URLStreamHandlerFactory {
  41     /**
  42      * Creates a new {@code URLStreamHandler} instance with the specified
  43      * protocol.
  44      *
  45      * @param   protocol   the protocol ("{@code ftp}",
  46      *                     "{@code http}", "{@code nntp}", etc.).
  47      * @return  a {@code URLStreamHandler} for the specific protocol.


  48      * @see     java.net.URLStreamHandler
  49      */
  50     URLStreamHandler createURLStreamHandler(String protocol);
  51 }


  27 
  28 /**
  29  * This interface defines a factory for {@code URL} stream
  30  * protocol handlers.
  31  * <p>
  32  * It is used by the {@code URL} class to create a
  33  * {@code URLStreamHandler} for a specific protocol.
  34  *
  35  * @author  Arthur van Hoff
  36  * @see     java.net.URL
  37  * @see     java.net.URLStreamHandler
  38  * @since   1.0
  39  */
  40 public interface URLStreamHandlerFactory {
  41     /**
  42      * Creates a new {@code URLStreamHandler} instance with the specified
  43      * protocol.
  44      *
  45      * @param   protocol   the protocol ("{@code ftp}",
  46      *                     "{@code http}", "{@code nntp}", etc.).
  47      * @return  a {@code URLStreamHandler} for the specific protocol, or {@code
  48      *          null} if this factory cannot create a handler for the specific
  49      *          protocol
  50      * @see     java.net.URLStreamHandler
  51      */
  52     URLStreamHandler createURLStreamHandler(String protocol);
  53 }