View Javadoc

1   /*
2    *  MicroEmulator
3    *  Copyright (C) 2001-2006 Bartek Teodorczyk <barteo@barteo.net>
4    *
5    *  It is licensed under the following two licenses as alternatives:
6    *    1. GNU Lesser General Public License (the "LGPL") version 2.1 or any newer version
7    *    2. Apache License (the "AL") Version 2.0
8    *
9    *  You may not use this file except in compliance with at least one of
10   *  the above two licenses.
11   *
12   *  You may obtain a copy of the LGPL at
13   *      http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt
14   *
15   *  You may obtain a copy of the AL at
16   *      http://www.apache.org/licenses/LICENSE-2.0
17   *
18   *  Unless required by applicable law or agreed to in writing, software
19   *  distributed under the License is distributed on an "AS IS" BASIS,
20   *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21   *  See the LGPL or the AL for the specific language governing permissions and
22   *  limitations.
23   */
24  
25  package org.microemu.app.util;
26  
27  import java.io.IOException;
28  import java.net.URL;
29  import java.net.URLConnection;
30  import java.net.URLStreamHandler;
31  import java.util.Hashtable;
32  
33  
34  
35  public class ResURLStreamHandler extends URLStreamHandler {
36  
37  	private Hashtable entries;
38  	
39  	public ResURLStreamHandler(Hashtable entries)
40  	{
41  		this.entries = entries;
42  	}
43  	
44  	protected URLConnection openConnection(URL url) throws IOException {
45  		return new ResURLConnection(url, entries);
46  	}
47  
48  }