Richard S. Hall | 864dc66 | 2006-09-26 16:53:29 +0000 | [diff] [blame] | 1 | /* |
Richard S. Hall | b395167 | 2006-09-19 17:04:53 +0000 | [diff] [blame] | 2 | * Licensed to the Apache Software Foundation (ASF) under one |
| 3 | * or more contributor license agreements. See the NOTICE file |
| 4 | * distributed with this work for additional information |
| 5 | * regarding copyright ownership. The ASF licenses this file |
| 6 | * to you under the Apache License, Version 2.0 (the |
| 7 | * "License"); you may not use this file except in compliance |
| 8 | * with the License. You may obtain a copy of the License at |
Richard S. Hall | 29a4fbc | 2006-02-03 12:54:52 +0000 | [diff] [blame] | 9 | * |
Richard S. Hall | b395167 | 2006-09-19 17:04:53 +0000 | [diff] [blame] | 10 | * http://www.apache.org/licenses/LICENSE-2.0 |
Richard S. Hall | 29a4fbc | 2006-02-03 12:54:52 +0000 | [diff] [blame] | 11 | * |
Richard S. Hall | b395167 | 2006-09-19 17:04:53 +0000 | [diff] [blame] | 12 | * Unless required by applicable law or agreed to in writing, |
| 13 | * software distributed under the License is distributed on an |
| 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | * KIND, either express or implied. See the License for the |
| 16 | * specific language governing permissions and limitations |
| 17 | * under the License. |
Richard S. Hall | 29a4fbc | 2006-02-03 12:54:52 +0000 | [diff] [blame] | 18 | */ |
| 19 | package org.apache.felix.moduleloader; |
| 20 | |
| 21 | import java.io.IOException; |
| 22 | import java.io.InputStream; |
| 23 | import java.net.URL; |
Richard S. Hall | 864dc66 | 2006-09-26 16:53:29 +0000 | [diff] [blame] | 24 | import java.util.Enumeration; |
Richard S. Hall | 29a4fbc | 2006-02-03 12:54:52 +0000 | [diff] [blame] | 25 | |
| 26 | public interface IContentLoader |
| 27 | { |
Richard S. Hall | 29a4fbc | 2006-02-03 12:54:52 +0000 | [diff] [blame] | 28 | public void close(); |
| 29 | |
| 30 | public IContent getContent(); |
| 31 | |
| 32 | public void setSearchPolicy(ISearchPolicy searchPolicy); |
| 33 | public ISearchPolicy getSearchPolicy(); |
| 34 | |
| 35 | public void setURLPolicy(IURLPolicy urlPolicy); |
| 36 | public IURLPolicy getURLPolicy(); |
| 37 | |
Karl Pauls | 28636dc | 2008-02-03 21:32:48 +0000 | [diff] [blame] | 38 | public void setSecurityContext(Object securityContext); |
| 39 | public Object getSecurityContext(); |
| 40 | |
Richard S. Hall | 29a4fbc | 2006-02-03 12:54:52 +0000 | [diff] [blame] | 41 | public Class getClass(String name); |
| 42 | public URL getResource(String name); |
Richard S. Hall | 864dc66 | 2006-09-26 16:53:29 +0000 | [diff] [blame] | 43 | public Enumeration getResources(String name); |
Richard S. Hall | 8d861e5 | 2006-09-25 18:29:27 +0000 | [diff] [blame] | 44 | public URL getResourceFromContent(String name); |
Richard S. Hall | 29a4fbc | 2006-02-03 12:54:52 +0000 | [diff] [blame] | 45 | |
Richard S. Hall | 8a3f400 | 2007-06-05 15:19:52 +0000 | [diff] [blame] | 46 | // TODO: ML - For expediency, the index argument was added to these methods |
| 47 | // but it is not clear that this makes sense in the long run. This needs to |
| 48 | // be readdressed in the future, perhaps by the spec to clearly indicate |
| 49 | // how resources on the bundle class path are searched, which is why we |
| 50 | // need the index number in the first place -- to differentiate among |
| 51 | // resources with the same name on the bundle class path. This was previously |
| 52 | // handled as part of the resource path, but that approach is not spec |
| 53 | // compliant. |
| 54 | public boolean hasInputStream(int index, String urlPath) |
Richard S. Hall | bbbf89c | 2006-07-27 08:58:11 +0000 | [diff] [blame] | 55 | throws IOException; |
Richard S. Hall | 8a3f400 | 2007-06-05 15:19:52 +0000 | [diff] [blame] | 56 | public InputStream getInputStream(int index, String urlPath) |
Richard S. Hall | 29a4fbc | 2006-02-03 12:54:52 +0000 | [diff] [blame] | 57 | throws IOException; |
| 58 | } |