/[classpath]/classpath/java/net/URLStreamHandler.java
ViewVC logotype

Diff of /classpath/java/net/URLStreamHandler.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.21 by mkoch, Wed Nov 26 15:33:34 2003 UTC revision 1.22 by mkoch, Thu Nov 27 09:52:56 2003 UTC
# Line 218  public abstract class URLStreamHandler Line 218  public abstract class URLStreamHandler
218                }                }
219              catch (IOException e)              catch (IOException e)
220                {                {
221                    // Do nothing.
222                }                }
223            }            }
224    
# Line 243  public abstract class URLStreamHandler Line 244  public abstract class URLStreamHandler
244      setURL(url, url.getProtocol(), host, port, file, ref);      setURL(url, url.getProtocol(), host, port, file, ref);
245    }    }
246        
247      /*
248       * Canonicalize a filename.
249       */
250    private static String canonicalizeFilename(String file)    private static String canonicalizeFilename(String file)
251    {    {
252      // XXX - GNU Classpath has an implementation that might be more appropriate      // XXX - GNU Classpath has an implementation that might be more appropriate
# Line 275  public abstract class URLStreamHandler Line 279  public abstract class URLStreamHandler
279     * @param url1 The first url     * @param url1 The first url
280     * @param url2 The second url to compare with the first     * @param url2 The second url to compare with the first
281     *     *
282       * @return True if both URLs point to the same file, false otherwise.
283       *
284     * @specnote Now protected     * @specnote Now protected
285     */     */
286    protected boolean sameFile(URL url1, URL url2)    protected boolean sameFile(URL url1, URL url2)
# Line 363  public abstract class URLStreamHandler Line 369  public abstract class URLStreamHandler
369     *     *
370     * @param url1 An URL object     * @param url1 An URL object
371     * @param url2 An URL object     * @param url2 An URL object
372       *
373       * @return True if both given URLs are equal, false otherwise.
374     */     */
375    protected boolean equals (URL url1, URL url2)    protected boolean equals (URL url1, URL url2)
376    {    {
# Line 395  public abstract class URLStreamHandler Line 403  public abstract class URLStreamHandler
403    /**    /**
404     * Compares the host components of two URLs.     * Compares the host components of two URLs.
405     *     *
406       * @param url1 The first URL.
407       * @param url2 The second URL.
408       *
409       * @return True if both URLs contain the same host.
410       *
411     * @exception UnknownHostException If an unknown host is found     * @exception UnknownHostException If an unknown host is found
412     */     */
413    protected boolean hostsEqual (URL url1, URL url2)    protected boolean hostsEqual (URL url1, URL url2)
# Line 417  public abstract class URLStreamHandler Line 430  public abstract class URLStreamHandler
430    /**    /**
431     * Get the IP address of our host. An empty host field or a DNS failure will     * Get the IP address of our host. An empty host field or a DNS failure will
432     * result in a null return.     * result in a null return.
433       *
434       * @param url The URL to return the host address for.
435       *
436       * @return The address of the hostname in url.
437     */     */
438    protected InetAddress getHostAddress (URL url)    protected InetAddress getHostAddress (URL url)
439    {    {
# Line 438  public abstract class URLStreamHandler Line 455  public abstract class URLStreamHandler
455    /**    /**
456     * Returns the default port for a URL parsed by this handler. This method is     * Returns the default port for a URL parsed by this handler. This method is
457     * meant to be overidden by handlers with default port numbers.     * meant to be overidden by handlers with default port numbers.
458       *
459       * @return The default port number.
460     */     */
461    protected int getDefaultPort ()    protected int getDefaultPort ()
462    {    {
# Line 447  public abstract class URLStreamHandler Line 466  public abstract class URLStreamHandler
466    /**    /**
467     * Provides the default hash calculation. May be overidden by handlers for     * Provides the default hash calculation. May be overidden by handlers for
468     * other protocols that have different requirements for hashCode calculation.     * other protocols that have different requirements for hashCode calculation.
469       *
470       * @param url The URL to calc the hashcode for.
471       *
472       * @return The hashcode for the given URL.
473     */     */
474    protected int hashCode (URL url)    protected int hashCode (URL url)
475    {    {
# Line 462  public abstract class URLStreamHandler Line 485  public abstract class URLStreamHandler
485     * that have a different syntax should override this method     * that have a different syntax should override this method
486     *     *
487     * @param url The URL object to convert     * @param url The URL object to convert
488       *
489       * @return A string representation of the url
490     */     */
491    protected String toExternalForm(URL u)    protected String toExternalForm(URL u)
492    {    {
# Line 498  public abstract class URLStreamHandler Line 523  public abstract class URLStreamHandler
523          if (user != null && !"".equals(user))          if (user != null && !"".equals(user))
524            sb.append(user).append('@');            sb.append(user).append('@');
525          sb.append(host);          sb.append(host);
526        
527          // Append port if port was in URL spec.          // Append port if port was in URL spec.
528          if (port >= 0)          if (port >= 0)
529            sb.append(':').append(port);            sb.append(':').append(port);
530        }        }
531    

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.22

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26