From: cvs@openprivacy.orgCVS update: talon/src/java/talon/util/net
Date: Sunday February 18, 19101 @ 22:49
Author: burton
CVSWEB Options: -------------------
Main CVSWeb: http://openprivacy.org/cgi-bin/cvsweb/cvsweb.cgi
View this module: http://openprivacy.org/cgi-bin/cvsweb/cvsweb.cgi/talon/src/java/talon/util/net
-----------------------------------
Update of /usr/local/cvs/public/talon/src/java/talon/util/net
In directory giga:/tmp/cvs-serv25588/src/java/talon/util/net
Modified Files:
URI.java
Log Message:
...
*****************************************************************
File: talon/src/java/talon/util/net/URI.java
CVSWEB Options: -------------------
CVSWeb: Annotate this file: http://openprivacy.org/cgi-bin/cvsweb/cvsweb.cgi/talon/src/java/talon/util/net/URI.java?annotate=1.2
CVSWeb: View this file: http://openprivacy.org/cgi-bin/cvsweb/cvsweb.cgi/talon/src/java/talon/util/net/URI.java?rev=1.2&content-type=text/x-cvsweb-markup
CVSWeb: Diff to previous version: http://openprivacy.org/cgi-bin/cvsweb/cvsweb.cgi/talon/src/java/talon/util/net/URI.java.diff?r1=1.2&r2=1.1
-----------------------------------
Index: talon/src/java/talon/util/net/URI.java
diff -u talon/src/java/talon/util/net/URI.java:1.1 talon/src/java/talon/util/net/URI.java:1.2
--- talon/src/java/talon/util/net/URI.java:1.1 Fri Jan 26 05:56:06 2001
+++ talon/src/java/talon/util/net/URI.java Sun Feb 18 22:49:55 2001
@@ -6,9 +6,9 @@
* Foundation; either version 2 of the License, or any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc., 59 Temple
@@ -23,7 +23,7 @@
* TODO: use a regexp on the reference to verify it is a valid URI.
*
* @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
- * @version $Id: URI.java,v 1.1 2001/01/26 13:56:06 burton Exp $
+ * @version $Id: URI.java,v 1.2 2001/02/19 06:49:55 burton Exp $
*/
public class URI {
@@ -35,7 +35,7 @@
* Noop constructor if called as a bean.
*
* @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
- * @version $Id: URI.java,v 1.1 2001/01/26 13:56:06 burton Exp $
+ * @version $Id: URI.java,v 1.2 2001/02/19 06:49:55 burton Exp $
*/
public URI() { }
@@ -44,7 +44,7 @@
*
*
* @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
- * @version $Id: URI.java,v 1.1 2001/01/26 13:56:06 burton Exp $
+ * @version $Id: URI.java,v 1.2 2001/02/19 06:49:55 burton Exp $
*/
public URI( String reference ) {
this.reference = reference;
@@ -54,7 +54,7 @@
*
*
* @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
- * @version $Id: URI.java,v 1.1 2001/01/26 13:56:06 burton Exp $
+ * @version $Id: URI.java,v 1.2 2001/02/19 06:49:55 burton Exp $
*/
public URI( String reference,
boolean isURL ) {
@@ -67,7 +67,7 @@
/**
* @see Object.toString#
* @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
- * @version $Id: URI.java,v 1.1 2001/01/26 13:56:06 burton Exp $
+ * @version $Id: URI.java,v 1.2 2001/02/19 06:49:55 burton Exp $
*/
public String toString() {
return this.reference;
@@ -77,7 +77,7 @@
* Return true if this URL is network locatable.
*
* @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
- * @version $Id: URI.java,v 1.1 2001/01/26 13:56:06 burton Exp $
+ * @version $Id: URI.java,v 1.2 2001/02/19 06:49:55 burton Exp $
*/
public boolean isURL() {
return this.isURL;
@@ -88,7 +88,7 @@
*
*
* @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
- * @version $Id: URI.java,v 1.1 2001/01/26 13:56:06 burton Exp $
+ * @version $Id: URI.java,v 1.2 2001/02/19 06:49:55 burton Exp $
*/
public String getReference() {
return this.reference;
@@ -98,12 +98,35 @@
*
*
* @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
- * @version $Id: URI.java,v 1.1 2001/01/26 13:56:06 burton Exp $
+ * @version $Id: URI.java,v 1.2 2001/02/19 06:49:55 burton Exp $
*/
public void setReference( String reference ) {
this.reference = reference;
}
+ /**
+ * Return the scheme of this URL. This is the portion of the URL before any
+ * addressing portion. This is usually expressed as
+ * scheme://resource_location. Example. URI -> http://www.openprivacy.org
+ * scheme -> http
+ *
+ * @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</a>
+ * @version $Id: URI.java,v 1.2 2001/02/19 06:49:55 burton Exp $
+ */
+ public String getScheme() {
+
+ String scheme = null;
+
+ int index = this.reference.indexOf( ":" );
+
+ if ( index != -1 ) {
+ scheme = this.reference.substring( 0, index );
+ }
+
+ return scheme;
+
+ }
+
}
This archive was generated by hypermail 2b30 : Sun Feb 18 2001 - 22:50:01 PST