KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > osgi > service > url > URLStreamHandlerService


1 /*
2  * $Header: /cvshome/build/org.osgi.service.url/src/org/osgi/service/url/URLStreamHandlerService.java,v 1.9 2006/07/11 00:53:59 hargrave Exp $
3  *
4  * Copyright (c) OSGi Alliance (2002, 2006). All Rights Reserved.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18
19 package org.osgi.service.url;
20
21 import java.net.*;
22
23 /**
24  * Service interface with public versions of the protected
25  * <code>java.net.URLStreamHandler</code> methods.
26  * <p>
27  * The important differences between this interface and the
28  * <code>URLStreamHandler</code> class are that the <code>setURL</code> method is
29  * absent and the <code>parseURL</code> method takes a
30  * {@link URLStreamHandlerSetter} object as the first argument. Classes
31  * implementing this interface must call the <code>setURL</code> method on the
32  * <code>URLStreamHandlerSetter</code> object received in the <code>parseURL</code>
33  * method instead of <code>URLStreamHandler.setURL</code> to avoid a
34  * <code>SecurityException</code>.
35  *
36  * @see AbstractURLStreamHandlerService
37  *
38  * @version $Revision: 1.9 $
39  */

40 public interface URLStreamHandlerService {
41     /**
42      * @see "java.net.URLStreamHandler.openConnection"
43      */

44     public URLConnection openConnection(URL u) throws java.io.IOException JavaDoc;
45
46     /**
47      * Parse a URL. This method is called by the <code>URLStreamHandler</code>
48      * proxy, instead of <code>java.net.URLStreamHandler.parseURL</code>, passing
49      * a <code>URLStreamHandlerSetter</code> object.
50      *
51      * @param realHandler The object on which <code>setURL</code> must be invoked
52      * for this URL.
53      * @see "java.net.URLStreamHandler.parseURL"
54      */

55     public void parseURL(URLStreamHandlerSetter realHandler, URL u,
56             String JavaDoc spec, int start, int limit);
57
58     /**
59      * @see "java.net.URLStreamHandler.toExternalForm"
60      */

61     public String JavaDoc toExternalForm(URL u);
62
63     /**
64      * @see "java.net.URLStreamHandler.equals(URL, URL)"
65      */

66     public boolean equals(URL u1, URL u2);
67
68     /**
69      * @see "java.net.URLStreamHandler.getDefaultPort"
70      */

71     public int getDefaultPort();
72
73     /**
74      * @see "java.net.URLStreamHandler.getHostAddress"
75      */

76     public InetAddress getHostAddress(URL u);
77
78     /**
79      * @see "java.net.URLStreamHandler.hashCode(URL)"
80      */

81     public int hashCode(URL u);
82
83     /**
84      * @see "java.net.URLStreamHandler.hostsEqual"
85      */

86     public boolean hostsEqual(URL u1, URL u2);
87
88     /**
89      * @see "java.net.URLStreamHandler.sameFile"
90      */

91     public boolean sameFile(URL u1, URL u2);
92 }
93
Popular Tags