01: /*=============================================================================
02: * Copyright Texas Instruments 2004. All Rights Reserved.
03: *
04: * This program is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License as published by the Free Software Foundation; either
07: * version 2 of the License, or (at your option) any later version.
08: *
09: * This program is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12: * Lesser General Public License for more details.
13: *
14: * You should have received a copy of the GNU Lesser General Public
15: * License along with this library; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17: *
18: * $ProjectHeader: OSCRIPT 0.155 Fri, 20 Dec 2002 18:34:22 -0800 rclark $
19: */
20:
21: package oscript.util;
22:
23: import java.net.URL;
24:
25: /**
26: * Sort of a hack to deal with eclipse, which needs to call some
27: * eclipse core APIs to convert a plugin URL to a native URL.
28: *
29: * @author Rob Clark (rob@ti.com)
30: * @version 1
31: */
32: public abstract class ResourceResolver {
33: private static ResourceResolver resolver = new ResourceResolver() {
34: public URL resolveImpl(URL url) {
35: return url;
36: }
37: };
38:
39: public static void setResourceResolver(ResourceResolver resolver) {
40: ResourceResolver.resolver = resolver;
41: }
42:
43: public static URL resolve(URL url) {
44: return resolver.resolveImpl(url);
45: }
46:
47: protected abstract URL resolveImpl(URL url);
48: }
49:
50: /*
51: * Local Variables:
52: * tab-width: 2
53: * indent-tabs-mode: nil
54: * mode: java
55: * c-indentation-style: java
56: * c-basic-offset: 2
57: * eval: (c-set-offset 'substatement-open '0)
58: * eval: (c-set-offset 'case-label '+)
59: * eval: (c-set-offset 'inclass '+)
60: * eval: (c-set-offset 'inline-open '0)
61: * End:
62: */
|