1 |
668
|
jones
|
/**
|
2 |
|
|
* '$RCSfile$'
|
3 |
|
|
* Purpose: Handle Metacat URL connections
|
4 |
|
|
* Copyright: 2000 Regents of the University of California and the
|
5 |
|
|
* National Center for Ecological Analysis and Synthesis
|
6 |
|
|
* Authors: Matt Jones
|
7 |
|
|
*
|
8 |
|
|
* '$Author$'
|
9 |
|
|
* '$Date$'
|
10 |
|
|
* '$Revision$'
|
11 |
|
|
*
|
12 |
|
|
* This program is free software; you can redistribute it and/or modify
|
13 |
|
|
* it under the terms of the GNU General Public License as published by
|
14 |
|
|
* the Free Software Foundation; either version 2 of the License, or
|
15 |
|
|
* (at your option) any later version.
|
16 |
|
|
*
|
17 |
|
|
* This program is distributed in the hope that it will be useful,
|
18 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
19 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
20 |
|
|
* GNU General Public License for more details.
|
21 |
|
|
*
|
22 |
|
|
* You should have received a copy of the GNU General Public License
|
23 |
|
|
* along with this program; if not, write to the Free Software
|
24 |
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
25 |
|
|
*/
|
26 |
|
|
|
27 |
563
|
jones
|
package edu.ucsb.nceas.protocols.metacat;
|
28 |
|
|
|
29 |
|
|
import java.net.URL;
|
30 |
|
|
import java.net.URLConnection;
|
31 |
|
|
|
32 |
668
|
jones
|
/**
|
33 |
|
|
* Class handling metacat scheme URLs by delegating connection requests
|
34 |
|
|
* to the MetacatURLConnection class
|
35 |
|
|
*/
|
36 |
563
|
jones
|
public class Handler extends java.net.URLStreamHandler
|
37 |
|
|
{
|
38 |
668
|
jones
|
/**
|
39 |
|
|
* Open a new connection to the URL by delegating to the MetacatURLConnection
|
40 |
|
|
*
|
41 |
|
|
* @param u the URL to which a connection is requested
|
42 |
|
|
*/
|
43 |
563
|
jones
|
protected URLConnection openConnection(URL u)
|
44 |
|
|
{
|
45 |
|
|
//...create and return a custom
|
46 |
|
|
// URLConnection initialized
|
47 |
|
|
// with a reference to the target
|
48 |
|
|
// URL object...
|
49 |
|
|
return new MetacatURLConnection(u);
|
50 |
|
|
}
|
51 |
|
|
}
|