KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cactus > integration > ant > deployment > JarArchive


1 /*
2  * ========================================================================
3  *
4  * Copyright 2003 The Apache Software Foundation.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
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 JavaDoc;
23 import java.io.InputStream JavaDoc;
24 import java.util.List JavaDoc;
25
26 /**
27  * Provide convenient methods to read information from a Jar archive.
28  *
29  * @since Cactus 1.5
30  * @version $Id: JarArchive.java,v 1.8 2004/02/29 10:15:47 vmassol Exp $
31  */

32 public interface JarArchive
33 {
34     /**
35      * Returns whether a class of the specified name is contained in the
36      * archive.
37      *
38      * @param theClassName The name of the class to search for
39      * @return Whether the class was found
40      * @throws IOException If an I/O error occurred reading the archive
41      */

42     boolean containsClass(String JavaDoc theClassName) throws IOException JavaDoc;
43
44     /**
45      * Returns the full path of a named resource in the archive.
46      *
47      * @param theName The name of the resource
48      * @return The full path to the resource inside the archive
49      * @throws IOException If an I/O error occurred reading the archive
50      */

51     String JavaDoc findResource(String JavaDoc theName) throws IOException JavaDoc;
52     
53     /**
54      * Returns a resource from the archive as input stream.
55      *
56      * @param thePath The path to the resource in the archive
57      * @return An input stream containing the specified resource, or
58      * <code>null</code> if the resource was not found in the JAR
59      * @throws IOException If an I/O error occurs
60      */

61     InputStream JavaDoc getResource(String JavaDoc thePath) throws IOException JavaDoc;
62     
63     /**
64      * Returns the list of resources in the specified directory.
65      *
66      * @param thePath The directory
67      * @return The list of resources
68      * @throws IOException If an I/O error occurs
69      */

70     List JavaDoc getResources(String JavaDoc thePath) throws IOException JavaDoc;
71 }
72
Popular Tags