/[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.8 by cbj, Mon Mar 25 05:12:18 2002 UTC revision 1.9 by mark, Fri Oct 18 20:40:50 2002 UTC
# Line 271  toExternalForm(URL url) Line 271  toExternalForm(URL url)
271    String file = url.getFile();    String file = url.getFile();
272    String anchor = url.getRef();    String anchor = url.getRef();
273    
274    return(((protocol != null) ? (protocol + "://") : "") +    StringBuffer sb = new StringBuffer(PlatformHelper.INITIAL_MAX_PATH);
275           ((host != null) ? host : "") +    
276           ((port != -1) ? (":" + port) : "") +    if (protocol != null){
277           ((file != null) ? file : "/") +      sb.append(protocol);
278           ((anchor != null) ? ("#" + anchor) : ""));      sb.append("://");
279      }
280      
281      if (host != null)
282        sb.append(host);
283        
284      if (port != -1){
285        sb.append(':');
286        sb.append(port);
287      }
288      
289      if (file != null)
290        sb.append(file);
291      else
292        sb.append('/');
293        
294      if (anchor != null){
295        sb.append('#');
296        sb.append(anchor);
297      }
298      
299      return sb.toString();
300    
301  }  }
302    
303  /*************************************************************************/  /*************************************************************************/

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

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