java/net/URL.getQuery
Tony Kimball
alk@pobox.com
Wed Jul 3 21:01:00 GMT 2002
I have a signed copy of a copyright assignement from RMS now.
This is a Java2 routine not previously implemented. Here's a patch
against the current HEAD:
@ spa:net$;cvs diff URL.java
cvs diff URL.java
Index: URL.java
===================================================================
RCS file: /cvsroot/gcc/gcc/libjava/java/net/URL.java,v
retrieving revision 1.10
diff -r1.10 URL.java
33a34
> private String query = null;
95a97,108
>
> int queryAt = file.lastIndexOf('?');
> if (queryAt < 0)
> {
> this.path = file;
> }
> else
> {
> this.path = file.substring(0, queryAt);
> this.query = file.substring(++queryAt);
> }
>
188a202,212
> int queryAt = file.lastIndexOf('?');
> if (queryAt < 0)
> {
> this.path = file;
> }
> else
> {
> this.path = file.substring(0, queryAt);
> this.query = file.substring(++queryAt);
> }
>
224,225c248,253
< int quest = file.indexOf('?');
< return quest < 0 ? file : file.substring(0, quest);
---
> return path;
> }
>
> public String getQuery()
> {
> return query;
More information about the Java-patches
mailing list