blob: f416e3ab257b490f8d69f670557e7422d3ed9332 [file] [log] [blame]
Richard S. Hall864dc662006-09-26 16:53:29 +00001/*
Richard S. Hallb3951672006-09-19 17:04:53 +00002 * 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. Hall29a4fbc2006-02-03 12:54:52 +00009 *
Richard S. Hallb3951672006-09-19 17:04:53 +000010 * http://www.apache.org/licenses/LICENSE-2.0
Richard S. Hall29a4fbc2006-02-03 12:54:52 +000011 *
Richard S. Hallb3951672006-09-19 17:04:53 +000012 * 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. Hall29a4fbc2006-02-03 12:54:52 +000018 */
19package org.apache.felix.moduleloader;
20
21import java.io.IOException;
22import java.io.InputStream;
23import java.net.URL;
Richard S. Hall864dc662006-09-26 16:53:29 +000024import java.util.Enumeration;
Richard S. Hall29a4fbc2006-02-03 12:54:52 +000025
26public interface IContentLoader
27{
Richard S. Hall29a4fbc2006-02-03 12:54:52 +000028 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 Pauls28636dc2008-02-03 21:32:48 +000038 public void setSecurityContext(Object securityContext);
39 public Object getSecurityContext();
40
Richard S. Hall29a4fbc2006-02-03 12:54:52 +000041 public Class getClass(String name);
42 public URL getResource(String name);
Richard S. Hall864dc662006-09-26 16:53:29 +000043 public Enumeration getResources(String name);
Richard S. Hall8d861e52006-09-25 18:29:27 +000044 public URL getResourceFromContent(String name);
Richard S. Hall29a4fbc2006-02-03 12:54:52 +000045
Richard S. Hall8a3f4002007-06-05 15:19:52 +000046 // 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. Hallbbbf89c2006-07-27 08:58:11 +000055 throws IOException;
Richard S. Hall8a3f4002007-06-05 15:19:52 +000056 public InputStream getInputStream(int index, String urlPath)
Richard S. Hall29a4fbc2006-02-03 12:54:52 +000057 throws IOException;
58}