    All Packages    This Package    Previous    Next

# Class net.www.html.URLStreamHandler

    java.lang.Object
       |
       +----net.www.html.URLStreamHandler

public class URLStreamHandler
extends Object

Subclasses of this class know how to create streams for particular protocol types

##

URLStreamHandler()

##

formatFromName(String)
  Try to guess the contents of a file based upon its extension.
openStream(URL)
  Open an input stream to the object referenced by the URL.
openStreamInteractively(URL)
  Similar to openStream except that it allows the stream handler to interact with the user to resolve certain problems.

##

URLStreamHandler

      public URLStreamHandler()

##

openStream

      public abstract InputStream openStream(URL u)

  Open an input stream to the object referenced by the URL. Should be overridden by a subclass. Failure is indicated by throwing an exception.
  Returns:
    The opened input stream. A value of null indicates that while the open was successful, there is no useful data provided by this protocol, it's done for side-effect only (the usual example is the "mailto" protocol).

openStreamInteractively

      public InputStream openStreamInteractively(URL u)

  Similar to openStream except that it allows the stream handler to interact with the user to resolve certain problems. For example, the http handler will prompt for a user name and password to handle authentication failures. In these cases, openStream would just toss an exception. If this method is not overridden, it behaves exactly like openStream.

formatFromName

      public static String formatFromName(String fname)

  Try to guess the contents of a file based upon its extension.

    All Packages    This Package    Previous    Next