01: /*
02: * ========================================================================
03: *
04: * Copyright 2003 The Apache Software Foundation.
05: *
06: * Licensed under the Apache License, Version 2.0 (the "License");
07: * you may not use this file except in compliance with the License.
08: * You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS,
14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15: * See the License for the specific language governing permissions and
16: * limitations under the License.
17: *
18: * ========================================================================
19: */
20: package org.apache.cactus.integration.ant.deployment;
21:
22: import java.io.IOException;
23: import java.io.InputStream;
24: import java.util.List;
25:
26: /**
27: * Provide convenient methods to read information from a Jar archive.
28: *
29: * @since Cactus 1.5
30: * @version $Id: JarArchive.java 238812 2004-02-29 10:21:34Z vmassol $
31: */
32: public interface JarArchive {
33: /**
34: * Returns whether a class of the specified name is contained in the
35: * archive.
36: *
37: * @param theClassName The name of the class to search for
38: * @return Whether the class was found
39: * @throws IOException If an I/O error occurred reading the archive
40: */
41: boolean containsClass(String theClassName) throws IOException;
42:
43: /**
44: * Returns the full path of a named resource in the archive.
45: *
46: * @param theName The name of the resource
47: * @return The full path to the resource inside the archive
48: * @throws IOException If an I/O error occurred reading the archive
49: */
50: String findResource(String theName) throws IOException;
51:
52: /**
53: * Returns a resource from the archive as input stream.
54: *
55: * @param thePath The path to the resource in the archive
56: * @return An input stream containing the specified resource, or
57: * <code>null</code> if the resource was not found in the JAR
58: * @throws IOException If an I/O error occurs
59: */
60: InputStream getResource(String thePath) throws IOException;
61:
62: /**
63: * Returns the list of resources in the specified directory.
64: *
65: * @param thePath The directory
66: * @return The list of resources
67: * @throws IOException If an I/O error occurs
68: */
69: List getResources(String thePath) throws IOException;
70: }
|